/*

There are 2 categories of variables:

- Variables that start with DQ are cleaned variables easily to link to the
questionaire. These variables are ready for analysis.

- Variables that start with DP are auxiliar variables and not to be used for
analysis.

*/


use "$Baseline_dtRaw/surveys/150910_CEIS_BD_Directores_Final.dta", clear

set more off

********************************************************************************
************************************ INTRO *************************************
********************************************************************************
{
rename P13_Rec school_id
rename P12_Rec school_name
rename P02_Rec resp_name
rename Respondent_ID resp_id
rename DataCollection_StartTime time_start
rename DataCollection_FinishTime time_finish
rename P03 resp_position
rename JOG_PROF resp_idgame

rename P11 bairro_name
rename P14 resp_tel
rename ComunaDescricao commune_name

lab def resp_position 1	"Director" 2	"Deputy Director" 3	"Acting Director"
lab val resp_position resp_position

gen vil_id = 1 if inlist(school_id,1,	2,	3,	4,	5,	6,	7,	8,	9,	10,	12,	13,	14,	15,	16,	17,	18,	19,	20,	21,	22,	24,	25,	26,	27,	28,	29,	30,	31,	32,	33,	34,	35,	37,	40,	45,	61,	86,	110)
replace vil_id = 2 if inlist(school_id,23,	43,	44,	46,	47,	48,	49,	50,	51,	52,	53,	54,	55,	56,	57,	58,	59,	60,	62,	63,	64,	65,	66,	67,	68,	69,	70,	71,	72,	73,	75,	76,	77,	78,	79,	80,	81)
replace vil_id = 3 if inlist(school_id,11,	36,	38,	39,	41,	42,	74,	82,	83,	84,	85,	87,	88,	89,	90,	91,	92,	93,	94,	95,	96,	97,	98,	99,	101,	102,	103,	104,	105)
replace vil_id = 4 if inlist(school_id,118,	119,	120,	121,	122,	123,	124,	125)
replace vil_id = 5 if inlist(school_id,100,	112,	113,	114,	115,	116,	117)
replace vil_id = 6 if inlist(school_id,109,	111)
replace vil_id = 7 if inlist(school_id,106,	107)
replace vil_id = 8 if inlist(school_id,126)
replace vil_id = 9 if inlist(school_id,108)

lab def vil 1 "Sumbe" 2 "Porto Amboim" 3	"Gabela" 4	"Conda" 5	"Ebo" 6	"Quilenda" 7	"Seles" 8	"Cassongue" 9	"Quibala"
lab val vil_id vil

lab var school_id 			"ID number school"
lab var school_name 		"Name school"
lab var vil_id 				"ID number village, value label includes names"
lab var commune_name 		"Name commune"
lab var bairro_name 		"Name bairro"
lab var resp_id 			"ID number respondent"
lab var resp_name 			"Name main respondent"
lab var resp_position 		"Position of respondent at the school"
lab var resp_idgame			"ID Number respondent games (director)"
lab var resp_tel 			"Phone number main respondent"
lab var time_start 			"What time did the interview start?"
lab var time_finish 		"What time did the interview end?"

drop DataCollection_EndQuestion P0 P02 P13 P12 P14_Codes Provincia ProvinciaCodigo ProvinciaDescricao Municipio MunicipioCodigo MunicipioDescricao ComunaCodigo Comuna
order resp_id time_start time_finish school_id school_name resp_name resp_position resp_idgame resp_tel vil_id commune_name bairro_name

}
********************************************************************************
********************************** SECTION 1 ***********************************
********************************************************************************
{
drop P1_1_Codes P1_4_Codes P1_6_Codes P1_7_Codes P1_12_Codes P1_13_Codes P1_14_Codes P1_19_Codes P1_21_Codes

lab var P1_1 		"Age respondent"
lab var P1_2 		"Respondent is female"
lab var P1_3 		"Current home neighbourhood relative to the school"
lab var P1_3_C2		"Name current home neighbourhood if in other community/neighborhood of the commune where the school is located"
lab var P1_3_C3		"Name current home neighbourhood if in the centre of the municipality where the school is located"
lab var P1_3_C4		"Name current home neighbourhood if outside the municipality where the school is located"
lab var P1_4 		"Birthplace municipality"
lab var P1_5 		"Neighbourhood the respondent grew up in relative to the school"
lab var P1_5_C2		"Name neighbourhood the respondent grew up in if in other community/neighborhood of the commune where the school is located"
lab var P1_5_C3		"Name neighbourhood the respondent grew up in if in the centre of the municipality where the school is located"
lab var P1_5_C4		"Name neighbourhood the respondent grew up in if outside the municipality where the school is located"
lab var P1_6 		"Time of leaving birthplace"
lab var P1_7 		"Time of arriving current hometown"
lab var P1_8 		"Marital status"
lab var P1_9 		"Highest level of education enjoyed by partner"
lab var P1_10 		"Ocupation partner"
lab var P1_11 		"Monthly total home income"
lab var P1_12 		"How many of your children live in this (your) home?"
lab var P1_13 		"How many children live in this (your) home but are not your children?"
lab var P1_14 		"How many of the children who live in your house are girls?"
lab var P1_15 		"How many of the children living in this (your) home attend this elementary school?"
lab var P1_17 		"Language spoken at home"
lab var P1_18 		"Type of home in terms of ownership"
lab var P1_19 		"Aproximate distance in km between home and school"
lab var P1_20 		"Method of transportation used between home and school"
lab var P1_21 		"Time in minutes spend between home and school"

#delimit;
lab def dummy
1	"Yes"
0	"No"
;
lab def wrtschool
1 "This community/neighborhood where we are"
2 "Another community/neighborhood of the commune (1)"
3 "At the centre of the municipality (2)"
4 "Out of town (3)"
;
#delimit cr

rename P1_1 Q1_01

rename P1_2 Q1_02
recode Q1_02 (1=0) (2=1)
lab val Q1_02 dummy

rename P1_3 Q1_03
lab val Q1_03 wrtschool
rename P1_3_C2 Q1_03_01
rename P1_3_C3 Q1_03_02
rename P1_3_C4 Q1_03_03

rename P1_4 Q1_04

rename P1_5 Q1_05
rename P1_5_C2 Q1_05_01
rename P1_5_C3 Q1_05_02
rename P1_5_C4 Q1_05_03
lab val Q1_05 wrtschool

rename P1_6 Q1_06
rename P1_7 Q1_07
rename P1_8 Q1_08
rename P1_9 Q1_09
rename P1_10 Q1_10
rename P1_11 Q1_11
rename P1_12 Q1_12
rename P1_13 Q1_13
rename P1_14 Q1_14
rename P1_15 Q1_15

drop P1_10_C13

#delimit ;
;
lab def maritalstatus
1 "Married"
2 "De facto union"
3 "Single"
4 "Widowed"
5 "Divorced/separated"
;
lab val Q1_08 maritalstatus;
;
lab def edu1
1 "None"
2 "First grade"
3 "First level (former elementary school)"
4 "Second level (old high school, 5th and 6th grade)"
5 "Third level (former preparatory school, 7th and 8th grades)"
6 "High school (9th to 12th grade)"
7 "Professional technical education (2-4 years)"
8 "University - Angola"
9 "University - abroad"
10 "Post-graduation - Angola"
11 "Graduate - abroad"
;
lab val Q1_09 edu1;
;
lab def ocu
1 "Part-time salaried employment in the private sector"
2 "Part-time salaried employment in the public sector"
3 "Full-time salaried employment in the private sector"
4 "Full-time salaried employment in the public sector"
5 "Self-employment (does not employ other persons)"
6 "Owner of a business (employs other people)"
7 "Peasants (subsistence agriculture)"
8 "Farmer (employs others)"
9 "Retired"
10 "Student (still in school)"
11 "Domestic worker/housekeeper"
12 "Unemployed"
13 "Religious figure"
14 "Politician"
;
lab val Q1_10 ocu;
;
lab def income
1	"… <= 1 000 Cuanzas/mês."
2	"1 001 – 4 000 Cuanzas/mês."
3	"4 001 – 10 000 Cuanzas/mês."
4	"10 001 – 20 000 Cuanzas/mês."
5	"20 001 – 30 000 Cuanzas/mês."
6	"30 001 – 40 000 Cuanzas/mês."
7	"40 001 => … Cuanzas/mês."
;
lab val Q1_11 income;
#delimit cr

drop P1_16_8_Q P1_16_9_Q P1_16_10_Q

rename P1_16_0_Q Q1_16_01
rename P1_16_1_Q Q1_16_02
rename P1_16_2_Q Q1_16_03
rename P1_16_3_Q Q1_16_04
rename P1_16_4_Q Q1_16_05
rename P1_16_5_Q Q1_16_06
rename P1_16_6_Q Q1_16_07
rename P1_16_7_Q Q1_16_08

lab var Q1_16_01 "(1) School year of child that lives with respondent"
lab var Q1_16_02 "(2) School year of child that lives with respondent"
lab var Q1_16_03 "(3) School year of child that lives with respondent"
lab var Q1_16_04 "(4) School year of child that lives with respondent"
lab var Q1_16_05 "(5) School year of child that lives with respondent"
lab var Q1_16_06 "(6) School year of child that lives with respondent"
lab var Q1_16_07 "(7) School year of child that lives with respondent"
lab var Q1_16_08 "(8) School year of child that lives with respondent"

drop P1_17_C6 P1_18_C4

rename P1_17 Q1_17
rename P1_18 Q1_18
replace Q1_18 = . if Q1_18==4

#delimit ;
;
lab def language
1	"Portuguese"
2	"Umbundu"
3	"Kimbundu"
4	"Kicongo"
5	"Ngoia"
;
lab val Q1_17 language;
;
lab def home
1 "Own home"
2 "Rented home"
3 "Accommodation made available by community or family"
4 "Accommodation made available by state"
;
lab val Q1_18 home;
#delimit cr

rename P1_19 Q1_19
rename P1_20 Q1_20
rename P1_21 Q1_21

replace Q1_20 = . if Q1_20==6
replace Q1_20 = 4 if P1_20_C6=="Mototaxi"
replace Q1_20 = 6 if P1_20_C6=="Apoio do centro de apoio de forma��o profissional"
replace Q1_20 = 6 if P1_20_C6=="Boleia"

#delimit ;
;
lab def transport
1 "Walking"
2 "Bicycle"
3 "Candongueiro/taxi"
4 "Car"
5 "Motor bike"
6 "Hitchhiking"
;
lab val Q1_20 transport;
#delimit cr

order P1_20_C6, after(Q1_21)
}
********************************************************************************
********************************** SECTION 2 ***********************************
********************************************************************************
{
rename P2_1 Q2_01
recode Q2_01 (12=14) (11=13) (10=12) (9=11) (8=10) (7=9)

#delimit ;
;
lab def edu2
1 "First level (former primary school)."
2 "Second level (old high school, 5th and 6th grade)."
3 "Third level (former preparatory school, 7th and 8th grades)."
4 "High school (9th to 12th grade)."
5 "Professional technical education (2-4 years)."
6 "Pedagogical secondary school."
7 "University - 1 year of education studies."
8 "University - 2 years of education studies."
9 "University - 3 years of education studies."
10 "University - 4 years of education studies."
11 "University - 4 years of studies in another area."
12 "Post-graduation in education."
13 "Post-graduation in another area."
;
lab val Q2_01 edu2;
#delimit cr
lab var Q2_01 	"Highest level of education enjoyed by respondent"

replace Q2_01 = . if Q2_01==14
replace Q2_01 = 11 if P2_1_C12=="Licenciado"
replace Q2_01 = 8 if P2_1_C12=="2 ano isup"

rename P2_1_C9 Q2_01_uni
replace Q2_01_uni = "Matematica" if Q2_01_uni=="Matemática"
lab var Q2_01_uni 	"Area university degree if not education"
rename P2_1_C11 Q2_01_pos
replace Q2_01_pos = "Gestao Escolar" if Q2_01_pos=="Gestão Escolar"
lab var Q2_01_pos 	"Area post graduation degree if not education"

rename P2_2 Q2_02
recode Q2_02 (2=0)
lab val Q2_02 dummy
lab var Q2_02 "Respondent has had training in school management"

rename P2_31 Q2_03_01
rename P2_32 Q2_03_02
rename P2_33 Q2_03_03
rename P2_34 Q2_03_04
rename P2_35 Q2_03_05
rename P2_36 Q2_03_06
rename P2_37 Q2_03_07
*other option is useless

lab val Q2_03_* dummy

lab var Q2_03_01 	"Did not participate in any professional development activity since february 2012"
lab var Q2_03_02 	"Did management training since february 2012"
lab var Q2_03_03 	"Did university course about teaching since february 2012"
lab var Q2_03_04 	"Visited other schools to observe since february 2012"
lab var Q2_03_05 	"Received other directors and/or province representatives since february 2012"
lab var Q2_03_06 	"Participated in a professor network since february 2012"
lab var Q2_03_07 	"Participated in a workshop and/or conference since february 2012"

rename P2_4_0_C1 Q2_04_month
rename P2_4_0_C2 Q2_04_year
replace Q2_04_year = . if Q2_04_year==1900
lab var Q2_04_month "Month respondent became director"
lab var Q2_04_year "Year respondent became director"

#delimit ;
;
lab def months
1	"January"
2	"February"
3	"March"
4	"April"
5	"May"
6	"June"
7	"July"
8	"August"
9	"September"
10	"October"
11	"November"
12	"December"
;
lab val Q2_04_month months;
#delimit cr

rename P2_5 Q2_05
recode Q2_05 (2=0)
lab val Q2_05 dummy
lab var Q2_05 "Someone helped you to become nominated as director of this school?"

rename P2_6(#) Q2_06_0(#)

forval n=1/6{
replace Q2_06_0`n' = . if Q2_05==0
}
replace Q2_06_07 = .
replace Q2_06_07 = 1 if P2_6_C7=="Igreja"

gen Q2_06_08 = 0 if Q2_05==1
replace Q2_06_08 = 1 if P2_6_C7=="Coordenador da zona"

egen tot = rowtotal(Q2_06_01 Q2_06_02 Q2_06_03 Q2_06_04 Q2_06_05 Q2_06_06 Q2_06_07 Q2_06_08), missing

replace Q2_05 = 0 if tot==0

forval n=1/8{
replace Q2_06_0`n' = . if Q2_05==0
lab val Q2_06_0`n' dummy
}


drop tot

order Q2_06_08, after(Q2_06_07)

lab var Q2_06_01 "Someone of the ministry of education helped with the nomination"
lab var Q2_06_02 "Someone of the provincial direction of education helped with the nomination"
lab var Q2_06_03 "Someone of the municipality administration helped with the nomination"
lab var Q2_06_04 "Director of the school helped with the nomination"
lab var Q2_06_05 "Political party helped with the nomination"
lab var Q2_06_06 "A professor of the school helped with the nomination"
lab var Q2_06_07 "The church helped with the nomination"
lab var Q2_06_08 "Area coordenator helped with the nomination"

rename P2_7 Q2_07
replace Q2_07=. if Q2_07==5
replace Q2_07 = 4 if P2_7_C_5=="Coordenação escolar"
replace Q2_07 = 4 if P2_7_C_5=="indicaçao da coordenaçao"
replace Q2_07 = 4 if P2_7_C_5=="nomeado pelo primeiro director"
replace Q2_07 = 5 if P2_7_C_5=="Coordenação Municipal"
replace Q2_07 = 5 if P2_7_C_5=="Coordenador de zona"
replace Q2_07 = 5 if P2_7_C_5=="Indicada pela repartição"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pela direção Municipal"
replace Q2_07 = 5 if P2_7_C_5=="indicado pela direção municipal da educação"
replace Q2_07 = 5 if P2_7_C_5=="indicado pelo chefe da repartição"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pelo chefe da repartição daceducação"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pelo coordenador"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pelo coordenador da repartição municipal"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pelo coordenador de zona"
replace Q2_07 = 5 if P2_7_C_5=="indicado pelo repartição municipal"
replace Q2_07 = 5 if P2_7_C_5=="Indicado pelo soba"
replace Q2_07 = 5 if P2_7_C_5=="indicado repartição municipal"
replace Q2_07 = 5 if P2_7_C_5=="Indicados pelacoordenação"
replace Q2_07 = 5 if P2_7_C_5=="proposta da repartição municipal"
replace Q2_07 = 5 if P2_7_C_5=="REPARTIÇAO MUNICIPAL DE EDUCAÇAO"
replace Q2_07 = 5 if P2_7_C_5=="REPARTIÇAO MUNUCIPAL DE EDUCAÇAO"
replace Q2_07 = 5 if P2_7_C_5=="repartição municipal"
replace Q2_07 = 5 if P2_7_C_5=="Repartição Municipal da Educação"
replace Q2_07 = 5 if P2_7_C_5=="repartiçao"
replace Q2_07 = 5 if P2_7_C_5=="repartiçao municipal da educaçao"
replace Q2_07 = 6 if P2_7_C_5=="Rotatividade"
replace Q2_07 = 6 if P2_7_C_5=="Rotatividade de trabalho"
replace Q2_07 = 6 if P2_7_C_5=="Rotatividade dos diretores"
replace Q2_07 = 7 if P2_7_C_5=="Igreja"

#delimit ;
;
lab def Q2_07
1	"Antiquity: years of teaching in this school."
2	"Nominated by the procincial direction of education"
3	"Nominated by the ministry of education."
4	"Nominated by the school direction"
5	"Nominated by village/local coordenation"
6	"Automatic rotation"
7	"Nominated by the church"
;
lab val Q2_07 Q2_07;
#delimit cr

lab var Q2_07 "How did you become director of this school?"

rename P2_8 Q2_08
recode Q2_08 (2=0)
lab val Q2_08 dummy
lab var Q2_08 "Respondent was deputy director at this school before becoming director"

rename P2_9 Q2_09
recode Q2_09 (2=0)
lab val Q2_09 dummy
lab var Q2_09 "Respondent was director at another school before becoming director at this school"

drop P2_10_Codes P2_11_Codes P2_12_Codes P2_13_Codes P2_14_Codes

rename P2_10 Q2_10
lab var Q2_10 "School where respondent was previously director"

rename P2_11 Q2_11
lab var Q2_11 "Neighborhood of school where respondent was previously director"

rename P2_12 Q2_12
lab var Q2_12 "Village of school where respondent was previously director"

gen Q2_13 = 2010 if P2_13=="09-2010"
replace Q2_13 = 2009 if P2_13=="09-2009"
replace Q2_13 = 2010 if P2_13=="10_2010"
replace Q2_13 = 2003 if P2_13=="08-2003"
replace Q2_13 = 2009 if P2_13=="02-2009"
replace Q2_13 = 2006 if P2_13=="01-02-2006"
replace Q2_13 = 2007 if P2_13=="6-2007"
replace Q2_13 = 2005 if P2_13=="1-2005"
replace Q2_13 = 2001 if P2_13=="09-2001"
replace Q2_13 = 2004 if P2_13=="02-2004"
replace Q2_13 = 1990 if P2_13=="02-1990"
replace Q2_13 = 2006 if P2_13=="10-2006"
replace Q2_13 = 1998 if P2_13=="6 1998"
replace Q2_13 = 2005 if P2_13=="02-2005"
replace Q2_13 = 2002 if P2_13=="02-2002"
replace Q2_13 = 2000 if P2_13=="2000"
replace Q2_13 = 2003 if P2_13=="9-2003"
replace Q2_13 = 2004 if P2_13=="10-2004"
replace Q2_13 = 1988 if P2_13=="1-1988"
replace Q2_13 = 2000 if P2_13=="2-2000"
replace Q2_13 = 1998 if P2_13=="9 1998"
replace Q2_13 = 2014 if P2_13=="12-2014"
replace Q2_13 = 2002 if P2_13=="06-202"
replace Q2_13 = 2010 if P2_13=="2 2010"
replace Q2_13 = 1998 if P2_13=="02-1998"
replace Q2_13 = 2003 if P2_13=="01-2003"
replace Q2_13 = 1987 if P2_13=="06-1987"
replace Q2_13 = 2013 if P2_13=="02-2013"
replace Q2_13 = 2003 if P2_13=="6-2003"
replace Q2_13 = 1982 if P2_13=="1-1982"
replace Q2_13 = 2006 if P2_13=="01-2006"
replace Q2_13 = 1987 if P2_13=="02-1987"
replace Q2_13 = 1994 if P2_13=="03-1994"
replace Q2_13 = 1999 if P2_13=="05-1999"
replace Q2_13 = 2005 if P2_13=="06-2005"
order Q2_13, after(Q2_12)
lab var Q2_13 "Year of nomination at school where respondent was previously director"

rename P2_14 Q2_14
lab var Q2_14 "Time as director at previous school in months"
replace Q2_14=. if Q2_09==0

* P2_14: problem in questioning!!

rename P2_15 Q2_15
replace Q2_15 = . if Q2_15==8
replace Q2_15 = 8 if P2_15_C_8=="Rotatividade dos diretores"
replace Q2_15 = 8 if P2_15_C_8=="Rotatividade de trabalho"
replace Q2_15 = 8 if P2_15_C_8=="rotatividade de quadros"
replace Q2_15 = 8 if P2_15_C_8=="Rotatividade de directores"
replace Q2_15 = 8 if P2_15_C_8=="Rotatividade"
replace Q2_15 = 8 if P2_15_C_8=="Movimentação de quadros"
replace Q2_15 = 9 if P2_15_C_8=="transferido pela direção Municipal"
replace Q2_15 = 9 if P2_15_C_8=="tranferidacpela repartição municipal"
replace Q2_15 = 9 if P2_15_C_8=="repartiçao da educaçao"
replace Q2_15 = 13 if P2_15_C_8=="Unificação das duas escolas"
replace Q2_15 = 13 if P2_15_C_8=="POR FALTA PROFESSOR PARA DAR AULAS NAS 5 E 6 CLASSES"
replace Q2_15 = 12 if P2_15_C_8=="guerra"
replace Q2_15 = 13 if P2_15_C_8=="era diretor dezona escolar"

#delimit ;
;
lab def Q2_15
1	"Transfer by the ministry"
2	"Did not like the location"
3	"Did not get along well with other professors"
4	"Did not get along well with director of the school"
5	"Did not get along well with parents"
6	"Personal reasons"
7	"Missing conditions for transport and/or housing (distance)"
8	"Automatic rotation"
9	"Transfer by village/local coordenation"
10	"Studies"
11	"Health"
12	"Armed conflict"
13	"Other"
;
lab val Q2_15 Q2_15;
#delimit cr

gen Q2_15_other = P2_15_C_8 if Q2_15==10
order Q2_15_other, after(Q2_15)
lab var Q2_15 "Reason for leaving previous school"
lab var Q2_15_other "Other reason for leaving previous school"

rename P2_16 Q2_16
recode Q2_16 (2=0)
lab val Q2_16 dummy
lab var Q2_16 "Respondent also teaches at this school"

rename P2_17 Q2_17
replace Q2_17 = . if Q2_16==0
lab var Q2_17 "Years teaching at this school"

rename P2_18 Q2_18
lab var Q2_18 "Years teaching at this school before being director"

rename P2_19 Q2_19
lab var Q2_19 "Years teaching before coming to this school"

rename P2_20 Q2_20
lab var Q2_20 "Expectation for how much longer at this school as director"

replace Q2_20 = 2 if P2_20_C_6=="até decisão superior"
replace Q2_20 = 2 if P2_20_C_6=="Durante o mandato"
replace Q2_20 = 3 if P2_20_C_6=="pouco tempo em reforma"
replace Q2_20 = 6 if P2_20_C_6=="2"
replace Q2_20 = 6 if P2_20_C_6=="1ano"
replace Q2_20 = 6 if P2_20_C_6=="2 anos"
replace Q2_20 = 6 if P2_20_C_6=="mais 3 anos"
replace Q2_20 = 6 if P2_20_C_6=="Pretende sair"

#delimit ;
;
lab def Q2_20
1	"Until I can"
2	"Until I get authorized"
3	"Until you reach retirement age"
4	"It will probably continue unless something better appears"
5	"Undecided at this point"
6	"Less than 3 years"
;
lab val Q2_20 Q2_20;
#delimit cr

drop P2_21_Codes

rename P2_21 Q2_21
replace Q2_21 = 45000 if Q2_21==45
replace Q2_21 = 69000 if Q2_21==69
replace Q2_21 = 75000 if Q2_21==75
replace Q2_21 = 87000 if Q2_21==87
lab var Q2_21 "Monthly salary after tax"

rename P2_22 Q2_22
recode Q2_22 (2=0) (3=.)
lab val Q2_22 dummy
lab var Q2_22 "Is it possible for a director to receive a performance based bonus?"

rename P2_23 Q2_23
recode Q2_23 (2=0)
lab val Q2_23 dummy
lab var Q2_23 "Received bonus since february 2012"

rename P2_24(##) Q2_24_(##)

forval n=1/9{
replace Q2_24_0`n' = . if Q2_24_11==1
}
replace Q2_24_10 = . if Q2_24_11==1
replace Q2_24_11 = . if Q2_24_11==1
gen Q2_24_12 = 0 if Q2_24_11==0

replace Q2_24_02 = 1 if P2_24_C_10=="rendimento dos alunos"
replace Q2_24_10 = 1 if P2_24_C_10=="Capacidade de exucação das tarefas programadas"
replace Q2_24_10 = 1 if P2_24_C_10=="coordenação"
replace Q2_24_10 = 1 if P2_24_C_10=="cumprimento dos deveres"
replace Q2_24_10 = 1 if P2_24_C_10=="Cumprimento dos programas e actividade do sector"
replace Q2_24_10 = 1 if P2_24_C_10=="cumprimentos dos planos de actividade"
replace Q2_24_10 = 1 if P2_24_C_10=="DEPENDENTEMENTE DAS ACTIVIDADES DESENVOLVIDAS PELA ESCOLA"
replace Q2_24_10 = 1 if P2_24_C_10=="Expediente em dia"
replace Q2_24_10 = 1 if P2_24_C_10=="Mediante as actividades realizadas"
replace Q2_24_10 = 1 if P2_24_C_10=="Organização de expediente"
replace Q2_24_10 = 1 if P2_24_C_10=="Organização de xpeidiente"
replace Q2_24_10 = 1 if P2_24_C_10=="Organização do exxpediente"
replace Q2_24_10 = 1 if P2_24_C_10=="organização escolar e assiduidade"
replace Q2_24_10 = 1 if P2_24_C_10=="Regularidade de expediente"
replace Q2_24_10 = 1 if P2_24_C_10=="prestaçãodeserviço"
replace Q2_24_11 = 1 if P2_24_C_10=="apreciaçao subjectiva pelo diretor"
replace Q2_24_11 = 1 if P2_24_C_10=="disposiçao permanente do director"
replace Q2_24_11 = 1 if P2_24_C_10=="subjectiva ao director"
replace Q2_24_12 = 1 if P2_24_C_10=="com base no trabalho pedagogico"
replace Q2_24_12 = 1 if P2_24_C_10=="competÍncia profissional"
replace Q2_24_12 = 1 if P2_24_C_10=="DESEMPENHO PROFISSIONAL"
replace Q2_24_12 = 1 if P2_24_C_10=="Entrega de relatórios"
replace Q2_24_09 = 1 if P2_24_C_10=="Ficha padronizada do NAP"
replace Q2_24_09 = 1 if P2_24_C_10=="NAPE"
replace Q2_24_12 = 1 if P2_24_C_10=="Pelas fichas de avaliação"
replace Q2_24_12 = 1 if P2_24_C_10=="repartição municipal"

order Q2_24_12, after(Q2_24_11)

lab var Q2_24_01 "Performance of the directors is not measured"
lab var Q2_24_02 "Performance of the directors is measured through final results students"
lab var Q2_24_03 "Performance of the directors is measured through the class preperation of the professors"
lab var Q2_24_04 "Performance of the directors is measured through the assiduity of professors"
lab var Q2_24_05 "Performance of the directors is measured through standardized test results students"
lab var Q2_24_06 "Performance of the directors is measured through the organization of classes"
lab var Q2_24_07 "Performance of the directors is measured through the assiduity of students"
lab var Q2_24_08 "Performance of the directors is measured through the satisfaction of parents"
lab var Q2_24_09 "Performance of the directors is measured through the opinion of an inspector"
lab var Q2_24_10 "Performance of the directors is measured through the organization of tasks and activities"
lab var Q2_24_11 "Performance of the directors is measured through the opinion of the director"
lab var Q2_24_12 "Performance of the directors is measured through other means"

rename P2_25 Q2_25
replace Q2_25 = . if Q2_25==6
replace Q2_25 = 2 if P2_25_C_6=="Coordenador Escolar"
replace Q2_25 = 2 if P2_25_C_6=="director"
replace Q2_25 = 2 if P2_25_C_6=="diretor"
replace Q2_25 = 2 if P2_25_C_6=="ensinongeral"
replace Q2_25 = 2 if P2_25_C_6=="membros dacomissão de avaliação da direção de escola"
replace Q2_25 = 3 if P2_25_C_6=="chefe de repartição municipal"
replace Q2_25 = 3 if P2_25_C_6=="comissao da repartiçao municipal"
replace Q2_25 = 3 if P2_25_C_6=="Coordenação Comunal"
replace Q2_25 = 3 if P2_25_C_6=="coordenador comunal"
replace Q2_25 = 3 if P2_25_C_6=="coordenador de zona"
replace Q2_25 = 3 if P2_25_C_6=="direção municipal dexeducação"
replace Q2_25 = 3 if P2_25_C_6=="Diretor comunal"
replace Q2_25 = 3 if P2_25_C_6=="Diretor municipal"
replace Q2_25 = 3 if P2_25_C_6=="Repartição municipal"
replace Q2_25 = 3 if P2_25_C_6=="repartiçãomunicipal"
replace Q2_25 = 3 if P2_25_C_6=="Coordenação"
replace Q2_25 = 5 if P2_25_C_6=="Inspeção(NAPE)"
replace Q2_25 = . if P2_25_C_6=="n sabe"
replace Q2_25 = . if P2_25_C_6=="Não é avaliado com director"

rename P2_26 Q2_26
replace Q2_26 = . if inlist(Q2_26,6,7)
replace Q2_26 = 6 if P2_26_C_6=="apenas a nota"
replace Q2_26 = 6 if P2_26_C_6=="apoio moral"
replace Q2_26 = 6 if P2_26_C_6=="avaliação possitiva"
replace Q2_26 = 6 if P2_26_C_6=="avaliaçao possitiva"
replace Q2_26 = 6 if P2_26_C_6=="é só uma classificação verbal e escrita."
replace Q2_26 = 6 if P2_26_C_6=="Elogios"
replace Q2_26 = 6 if P2_26_C_6=="maior empenho e dedicaçao"
replace Q2_26 = 4 if P2_26_C_6=="Promoção, crédito e transfrencia"

rename P2_27 Q2_27
replace Q2_27 = . if inlist(Q2_27,6,7)
replace Q2_27 = 4 if P2_27_C_6=="despromoção"
replace Q2_27 = 4 if P2_27_C_6=="despromoçao"
replace Q2_27 = 4 if P2_27_C_6=="Despromovido"
replace Q2_27 = 4 if P2_27_C_6=="ezoneração do cargo"
replace Q2_27 = 4 if P2_27_C_6=="Perde alguns direitos"
replace Q2_27 = 4 if P2_27_C_6=="Sob risco de despromoção"
replace Q2_27 = 6 if P2_27_C_6=="Aplicação de 1 proceso disciplinar"
replace Q2_27 = 6 if P2_27_C_6=="avaliação negativa"
replace Q2_27 = 6 if P2_27_C_6=="avaliaçao negativa"
replace Q2_27 = 6 if P2_27_C_6=="espera a avaliaçao"
replace Q2_27 = 6 if P2_27_C_6=="Reunião com a delegação provincial para uma chamada de atenção"
replace Q2_27 = . if P2_27_C_6=="procurar melhorar"

#delimit ;
;
lab def Q2_25
1	"Subdirector of the school"
2	"School direction"
3	"Direction of province/vilage/commune"
4	"Ministry of education"
5	"Task force (independent committee)"
;
lab def Q2_26
1	"Nothing happens"
2	"Financial bonus"
3	"“Medal” or something similar"
4	"Promotion to better position"
5	"Transfer to better school"
6	"Oral and/or written acknowledgement"
;
lab def Q2_27
1 "Nothing happens"
2 "Financial penalty"
3 "Transfer"
4 "Loss of director position"
5 "Dismissal"
6 "Oral and/or written notification"
;
lab val Q2_25 Q2_25;
lab val Q2_26 Q2_26;
lab val Q2_27 Q2_27;
#delimit cr

lab var Q2_25 "Responsible for evaluation of director"
lab var Q2_26 "Consequence of good performance"
lab var Q2_27 "Consequence of bad performance"

gen Q2_28 = 1 if P2_285==0
replace Q2_28 = 0 if P2_285==1
replace Q2_28 = 0 if P2_28_C_4=="apoio moral apenas"
lab val Q2_28 dummy
lab var Q2_28 "Directors receive some kind of aditional (financial) support"

order Q2_28, after(Q2_27)

rename P2_29 Q2_29
recode Q2_29 (2=0)
lab val Q2_29 dummy
lab var Q2_29 "Director has other source of income"

rename P2_30 Q2_30
replace Q2_30 = . if Q2_30==9
replace Q2_30 = . if Q2_29==0
replace Q2_30 = 9 if P2_30_C_9=="Criação de animais"

#delimit ;
;
lab def Q2_30
1 "Teaching in another public school."
2 "Teaching in a private school."
3 "Private paid lessons."
4 "Trade business"
5 "Agriculture"
6 "Non-agricultural enterprise"
7 "Fishing"
8 "Own business (informal)"
9 "Animals"
;
lab val Q2_30 Q2_30;
#delimit cr
lab var Q2_30 "Other source of income specified"

rename P2_311 Q2_31
replace Q2_31 = . if Q2_29==0
lab var Q2_31 "Other source of income value last month"

order P2_1_C12 P2_38 P2_3_C_8 P2_6_C7 P2_7_C_5 P2_13 P2_15_C_8 P2_20_C_6 P2_24_C_10 P2_25_C_6 P2_26_C_6 P2_27_C_6 P2_281 P2_282 P2_283 P2_284 P2_285 P2_286 P2_28_C_4 P2_30_C_9 P2_31_Codes, after(Q2_31)

lab var P2_1_C12 	"AUX"
lab var P2_38 		"AUX"
lab var P2_3_C_8 	"AUX"
lab var P2_6_C7 	"AUX"
lab var P2_7_C_5 	"AUX"
lab var P2_15_C_8 	"AUX"
lab var P2_20_C_6 	"AUX"
lab var P2_24_C_10 	"AUX"
lab var P2_25_C_6 	"AUX"
lab var P2_26_C_6 	"AUX"
lab var P2_27_C_6 	"AUX"
lab var P2_281 		"AUX"
lab var P2_282 		"AUX"
lab var P2_283 		"AUX"
lab var P2_284 		"AUX"
lab var P2_285 		"AUX"
lab var P2_286 		"AUX"
lab var P2_28_C_4 	"AUX"
lab var P2_30_C_9 	"AUX"
lab var P2_31_Codes "AUX"
}
********************************************************************************
********************************** SECTION 3 ***********************************
********************************************************************************
{
#delimit ;
;
lab def freq
1	"Very often"
2	"Often"
3	"Sometimes"
4	"Rarely"
5	"Never"
;
#delimit cr

rename P3_(#) Q3_0(#)

forval n=1/6{
replace Q3_0`n' = . if Q3_0`n'==6
lab val Q3_0`n' freq
}

lab var Q3_01 "How often do teachers give private classes to their own students?"
lab var Q3_02 "How often do teachers give private classes to other students?"
lab var Q3_03 "How often do parents ask the teacher of their child to give private classes?"
lab var Q3_04 "How often do parents ask another teacher to give private classes?"
lab var Q3_05 "How often do you give private classes to your own students"
lab var Q3_06 "How often do you give private classes to other students"

replace Q3_07 = . if Q3_06==5
lab var Q3_07 "Number of hours per week giving private classes"

drop P3_82 P3_83
rename P3_81 Q3_08
#delimit ;
;
lab def Q3_08
1	"School"
2	"Home teacher"
3	"Home student"
4	"Church"
5	"Community building"
6	"House family or friend"
7	"Rented space"
;
lab val Q3_08 Q3_08;
#delimit cr
lab var Q3_08 "Location of private classes"

replace Q3_09 = . if Q3_06==5
lab var Q3_09 "Hour tarif private classes"

rename P3_10 Q3_10

#delimit ;
;
lab def Q3_10
1 "Parents / guardians request private lessons for their children"
2 "Some students need extra help and support"
3 "More support is needed to cover all of the planned matter"
4 "You need more money to support your family"
;
lab val Q3_10 Q3_10;
#delimit cr
lab var Q3_10 "Main reason to give private classes (paid)"

rename P3_11 Q3_11
replace Q3_11 = . if Q3_11==5
lab var Q3_11 "Do you think private classes help students to perform better?"
#delimit ;
;
lab def Q3_11
1	"Usually helpful"
2	"Sometimes helpful"
3	"Rarely helpful"
4	"Not helpful"
;
lab val Q3_11 Q3_11;
#delimit cr

rename P3_12_Dinheiro_Q1	Q3_12_01_money
rename P3_12_Presente_Q1	Q3_12_01_gift
rename P3_12_Serviço_Q1		Q3_12_01_service

recode Q3_12_01_money (2=0)
recode Q3_12_01_gift (2=0)
recode Q3_12_01_service (2=0)

lab val Q3_12_01_money Q3_12_01_gift Q3_12_01_service dummy

destring P3_12_Presente_Q1_C1, replace
destring P3_12_Serviço_Q1_C1, replace

rename P3_12_Dinheiro_Q1_C1 Q3_12_02_money
rename P3_12_Presente_Q1_C1 Q3_12_02_gift
rename P3_12_Serviço_Q1_C1 Q3_12_02_service

lab var Q3_12_01_money 			"Received a present from parents in the form of money during the last year"
lab var Q3_12_01_gift 			"Received a present from parents in the form of an object during the last year"
lab var Q3_12_01_service 		"Received a present from parents in the form of a service during the last year"
lab var Q3_12_02_money 			"Value of monitary present"
lab var Q3_12_02_gift 			"Number of objects received as present"
lab var Q3_12_02_service 		"Hours of service received as present"

rename P3_13_C1_Q1 Q3_13_a
rename P3_13_C2_Q1 Q3_13_b
rename P3_13_C3_Q1 Q3_13_c
rename P3_13_C4_Q1 Q3_13_d
rename P3_13_C5_Q1 Q3_13_e

foreach var in Q3_13_a Q3_13_b Q3_13_c Q3_13_d Q3_13_e{
replace `var'=. if `var'==6
lab val `var' freq
}
lab var Q3_13_a "In general parents give gifts to segure a place in school for their child"
lab var Q3_13_b "In general parents give gifts to improve the results of their child"
lab var Q3_13_c "In general members of school direction are involved in corrupt activity"
lab var Q3_13_d "In general professors need to offer gifts to segure their job"
lab var Q3_13_e "In general professors give gifts to get better job placement"

#delimit ;
;
lab def agree
1	"Totally agree"
2	"Agree"
3	"Not agree nor disagree"
4	"Disagree"
5	"Totally disagree"
;
#delimit cr

rename P3_14_C1_Q1 Q3_14_a
rename P3_14_C2_Q1 Q3_14_b
rename P3_14_C3_Q1 Q3_14_c
rename P3_14_C4_Q1 Q3_14_d

foreach var in Q3_14_a Q3_14_b Q3_14_c Q3_14_d{
replace `var'=. if `var'==6
lab val `var' agree
}
lab var Q3_14_a "Agree or disagree: Private classes help students to understand the material better"
lab var Q3_14_b "Agree or disagree: Private classes give an unfair advantage to students that can pay"
lab var Q3_14_c "Agree or disagree: Private classes can be considered a corrupt activity"
lab var Q3_14_d "Agree or disagree: If the salaries of professors increase they will give less private classes"

rename P3_15_C1_Q1 Q3_15_a
rename P3_15_C2_Q1 Q3_15_b
rename P3_15_C3_Q1 Q3_15_c
rename P3_15_C4_Q1 Q3_15_d

foreach var in Q3_15_a Q3_15_b Q3_15_c Q3_15_d{
replace `var'=. if `var'==6
lab val `var' freq
}

lab var Q3_15_a "Misallocation of funds assigned to improving the infrastructure of the school"
lab var Q3_15_b "Misallocation of funds assigned to salaries of school employees"
lab var Q3_15_c "Misallocation of funds assigned to school books"
lab var Q3_15_d "Misallocation by means of selling books that should be free"

order P3_8_C6 P3_10_C5, after(Q3_15_d)
lab var P3_8_C6 "AUX"
lab var P3_10_C5 "AUX"
}
********************************************************************************
********************************** SECTION 4 ***********************************
********************************************************************************
{
lab var P4_1_C_1_P1 "Respondent is responisble for: Ensure a regular level of teacher attendance"
lab var P4_1_C_2_P1 "Respondent is responisble for: Ensure a regular level of student attendance"
lab var P4_1_C_3_P1 "Respondent is responisble for: Watch the course unfold"
lab var P4_1_C_4_P1 "Respondent is responisble for: Ensure that teachers make lesson plans and use them"
lab var P4_1_C_5_P1 "Respondent is responisble for: Ensure that teachers support and enlighten students"
lab var P4_1_C_6_P1 "Respondent is responisble for: Ensure that teaching materials are available to teachers"
lab var P4_1_C_7_P1 "Respondent is responisble for: Ensure that teachers do not give paid private lessons to students of their own class"
lab var P4_1_C_8_P1 "Respondent is responisble for: Ensure that teachers do not give paid private lessons to any student in the school"
lab var P4_1_C_9_P1 "Respondent is responisble for: Ensures student attendance records"
lab var P4_1_C_10_P1 "Respondent is responisble for: Update school accounts"
lab var P4_1_C_11_P1 "Respondent is responisble for: Ensure that school board meetings are recorded in minutes"
lab var P4_1_C_12_P1 "Respondent is responisble for: Ensure that operational management meetings are recorded in minutes"
lab var P4_1_C_13_P1 "Respondent is responisble for: Submit a development plan for the school year to the direction of the school"
lab var P4_1_C_14_P1 "Respondent is responisble for: Submit a report on school/student performance to the municipal/provincial board of education"

lab var P4_1_C_1_P2 "Time used in: Ensure a regular level of teacher attendance"
lab var P4_1_C_2_P2 "Time used in: Ensure a regular level of student attendance"
lab var P4_1_C_3_P2 "Time used in: Watch the course unfold"
lab var P4_1_C_4_P2 "Time used in: Ensure that teachers make lesson plans and use them"
lab var P4_1_C_5_P2 "Time used in: Ensure that teachers support and enlighten students"
lab var P4_1_C_6_P2 "Time used in: Ensure that teaching materials are available to teachers"
lab var P4_1_C_7_P2 "Time used in: Ensure that teachers do not give paid private lessons to students of their own class"
lab var P4_1_C_8_P2 "Time used in: Ensure that teachers do not give paid private lessons to any student in the school"
lab var P4_1_C_9_P2 "Time used in: Ensures student attendance records"
lab var P4_1_C_10_P2 "Time used in: Update school accounts"
lab var P4_1_C_11_P2 "Time used in: Ensure that school board meetings are recorded in minutes"
lab var P4_1_C_12_P2 "Time used in: Ensure that operational management meetings are recorded in minutes"
lab var P4_1_C_13_P2 "Time used in: Submit a development plan for the school year to the direction of the school"
lab var P4_1_C_14_P2 "Time used in: Submit a report on school/student performance to the municipal/provincial board of education"

lab var P4_1_C_1_P3 "Difficulty task: Ensure a regular level of teacher attendance"
lab var P4_1_C_2_P3 "Difficulty task: Ensure a regular level of student attendance"
lab var P4_1_C_3_P3 "Difficulty task: Watch the course unfold"
lab var P4_1_C_4_P3 "Difficulty task: Ensure that teachers make lesson plans and use them"
lab var P4_1_C_5_P3 "Difficulty task: Ensure that teachers support and enlighten students"
lab var P4_1_C_6_P3 "Difficulty task: Ensure that teaching materials are available to teachers"
lab var P4_1_C_7_P3 "Difficulty task: Ensure that teachers do not give paid private lessons to students of their own class"
lab var P4_1_C_8_P3 "Difficulty task: Ensure that teachers do not give paid private lessons to any student in the school"
lab var P4_1_C_9_P3 "Difficulty task: Ensures student attendance records"
lab var P4_1_C_10_P3 "Difficulty task: Update school accounts"
lab var P4_1_C_11_P3 "Difficulty task: Ensure that school board meetings are recorded in minutes"
lab var P4_1_C_12_P3 "Difficulty task: Ensure that operational management meetings are recorded in minutes"
lab var P4_1_C_13_P3 "Difficulty task: Submit a development plan for the school year to the direction of the school"
lab var P4_1_C_14_P3 "Difficulty task: Submit a report on school/student performance to the municipal/provincial board of education"


lab var P4_41 "(1) Of the following actions that aim to reinforce the support of the parents / guardians to the school, which ones did you most strive to promote in the previous academic year (2013)?"
lab var P4_42 "(2) Of the following actions that aim to reinforce the support of the parents / guardians to the school, which ones did you most strive to promote in the previous academic year (2013)?"
lab var P4_43 "(3) Of the following actions that aim to reinforce the support of the parents / guardians to the school, which ones did you most strive to promote in the previous academic year (2013)?"
lab var P4_51 "(1) Of the following actions aimed at disciplining students, which ones did you most use in the previous school year (2013)?"
lab var P4_52 "(2) Of the following actions aimed at disciplining students, which ones did you most use in the previous school year (2013)?"
lab var P4_53 "(3) Of the following actions aimed at disciplining students, which ones did you most use in the previous school year (2013)?"
lab var P4_61 "(1) Of the following actions that aim to combat students' absences, which ones did you most use in the previous academic year (2013)?"
lab var P4_62 "(2) Of the following actions that aim to combat students' absences, which ones did you most use in the previous academic year (2013)?"
lab var P4_63 "(3) Of the following actions that aim to combat students' absences, which ones did you most use in the previous academic year (2013)?"
lab var P4_71 "(1) From the following actions that aim to combat the repeated and excessive absences of teachers, which ones did you use most in the previous academic year (2013)?"
lab var P4_72 "(2) From the following actions that aim to combat the repeated and excessive absences of teachers, which ones did you use most in the previous academic year (2013)?"
lab var P4_73 "(3) From the following actions that aim to combat the repeated and excessive absences of teachers, which ones did you use most in the previous academic year (2013)?"

rename P4_1_C_(#)_P1 Q4_01_0(#)
rename P4_1_C_(#)_P2 Q4_02_0(#)
rename P4_1_C_(#)_P3 Q4_03_0(#)

rename P4_1_C_(##)_P1 Q4_01_(##)
rename P4_1_C_(##)_P2 Q4_02_(##)
rename P4_1_C_(##)_P3 Q4_03_(##)

foreach var in Q4_01_01 Q4_01_02 Q4_01_03 Q4_01_04 Q4_01_05 Q4_01_06 Q4_01_07 Q4_01_08 Q4_01_09 Q4_01_10 Q4_01_11 Q4_01_12 Q4_01_13 Q4_01_14{
recode `var' (2=0)
lab val `var' dummy
}

#delimit
lab def time
0	"None"
1	"Very little"
2	"Little"
3	"Much"
4	"Very much"
;
#delimit cr

foreach var in Q4_02_01 Q4_02_02 Q4_02_03 Q4_02_04 Q4_02_05 Q4_02_06 Q4_02_07 Q4_02_08 Q4_02_09 Q4_02_10 Q4_02_11 Q4_02_12 Q4_02_13 Q4_02_14{
replace `var' = . if inlist(`var',6,7)
replace `var' = `var'-1
lab val `var' time
}

#delimit
lab def dif
1	"Very easy"
2	"Easy"
3	"Difficult"
4	"Very difficult"
;
#delimit cr

foreach var in Q4_03_01 Q4_03_02 Q4_03_03 Q4_03_04 Q4_03_05 Q4_03_06 Q4_03_07 Q4_03_08 Q4_03_09 Q4_03_10 Q4_03_11 Q4_03_12 Q4_03_13 Q4_03_14{
replace `var' = . if inlist(`var',5,6)
lab val `var' dif
}

#delimit
lab def Q4_04
1 "Encourage parents/guardians to visit the school and meet with teachers"
2 "Encourage parents/guardians to set up/develop their committees"
3 "Encourage parents/guardians to attend school board meetings"
4 "Encourage the collection of opinions of parents/guardians as a means of self-evaluation of the school"
5 "Encourage parents/guardians to help their children with learning the subject"
;
lab def Q4_05
1 "Suspend and/or expel"
2 "Punish physically"
3 "Give extra classes and/or homework to students"
4 "Keep students in the classroom/school outside of normal class time"
5 "Prohibit some sport/other playful activity"
6 "Send communication or speak to parents/guardians"
7 "Forcing physical or manual labor"
8 "Forcing the interval to pass within the room"
9 "Conversations with students and lectures"
;
lab def Q4_06
1 "Suspend and/or expel"
2 "Punish physically"
3 "Give extra classes and/or homework to students"
4 "Keep students in the classroom/school outside of normal class time"
5 "Prohibit some sport/other playful activity"
6 "Send communication or speak to parents/guardians"
7 "Forcing physical or manual labor"
8 "Forcing the interval to pass within the room"
9 "Conversations with students and lectures"
;
lab def Q4_07
1 "There were no such problems"
2 "No action was taken, although there were such problems"
3 "Notice/call to the teacher"
4 "The case was reported to the provincial/municipal education board"
5 "The case was reported to the school board"
6 "Suspension/transfer"
7 "Discounting salary"
;
#delimit cr

rename P4_41 Q4_04_01
rename P4_42 Q4_04_02
rename P4_43 Q4_04_03

foreach var in Q4_04_01 Q4_04_02 Q4_04_03{
replace `var' = . if `var'==5
lab val `var' Q4_04
}

replace Q4_04_01 = 5 if P4_4_C5=="Incentivar o encarregados de educação no acompanhamento ‡ escola no processo de aprendizagem e combater a pré delinquencia juvenil"

rename P4_51 Q4_05_01
rename P4_52 Q4_05_02
rename P4_53 Q4_05_03

foreach var in Q4_05_01 Q4_05_02 Q4_05_03{
replace `var' = . if `var'==9
lab val `var' Q4_05
}

replace Q4_05_01 = 6 if P4_5_C9=="envolvimnto pais"
replace Q4_05_01 = 7 if P4_5_C9=="regar plantas aos sabados"
replace Q4_05_01 = 7 if P4_5_C9=="obrigar a limpar a casa de banho e varrerxa patio da escola"
replace Q4_05_01 = 7 if P4_5_C9=="recolha de residuos solidos no envoltorio da escols"
replace Q4_05_01 = 9 if P4_5_C9=="repeenção oral e coletiva."

replace Q4_05_02 = 1 if P4_5_C9=="tranferencia"
replace Q4_05_02 = 2 if P4_5_C9=="Não dar a merenda escolar"
replace Q4_05_02 = 6 if P4_5_C9=="chamarbo encarregado de educaçao para em conjunto com a escola para melhorar a escola"
replace Q4_05_02 = 6 if P4_5_C9=="intervençã8 dos soba"
replace Q4_05_02 = 7 if P4_5_C9=="limpeza"
replace Q4_05_02 = 7 if P4_5_C9=="Limpeza"
replace Q4_05_02 = 7 if P4_5_C9=="Limpeza, capinar"
replace Q4_05_02 = 7 if P4_5_C9=="limpezas"
replace Q4_05_02 = 7 if P4_5_C9=="Varrer a sala, acarretar agua"
replace Q4_05_02 = 9 if P4_5_C9=="chamada de atenção"
replace Q4_05_02 = 9 if P4_5_C9=="Chamada de atenção..."
replace Q4_05_02 = 9 if P4_5_C9=="Dialogo com o aluno"
replace Q4_05_02 = 9 if P4_5_C9=="Falar com proprio aluno"
replace Q4_05_02 = 9 if P4_5_C9=="palestras"
replace Q4_05_02 = 9 if P4_5_C9=="Palestras"
replace Q4_05_02 = 9 if P4_5_C9=="Palestras da investigação"
replace Q4_05_02 = 9 if P4_5_C9=="Palestras, Teatros"
replace Q4_05_02 = 9 if P4_5_C9=="sensibilizar a criança para no futuro no futura nao cometr o mesmo eeer"
replace Q4_05_02 = 9 if P4_5_C9=="ter mais conversa com os alunos"

replace Q4_05_03 = 7 if P4_5_C9=="LIMPAR O PATIO DA ESCOLA"

rename P4_61 Q4_06_01
rename P4_62 Q4_06_02
rename P4_63 Q4_06_03

foreach var in Q4_06_01 Q4_06_02 Q4_06_03{
replace `var' = . if `var'==9
lab val `var' Q4_06
}

replace Q4_06_01 = 9 if P4_6_C9=="Reprovação"
replace Q4_06_01 = 6 if P4_6_C9=="sensibilização nosencarregados"

replace Q4_06_02 = 1 if P4_6_C9=="transferencia"
replace Q4_06_02 = 6 if P4_6_C9=="Notificar o soba e a comisão de pais para apelar as comunidades porque isto varia com a época de agricultura do ano"
replace Q4_06_02 = 7 if P4_6_C9=="Limpeza"
replace Q4_06_02 = 9 if P4_6_C9=="dialogo, palestras"
replace Q4_06_02 = 9 if P4_6_C9=="e dizer q os desistentes n teriam ac3sso as matriculas"
replace Q4_06_02 = 9 if P4_6_C9=="FALAR COM O ALUN9"
replace Q4_06_02 = 9 if P4_6_C9=="Palestras"

rename P4_71 Q4_07_01
rename P4_72 Q4_07_02
rename P4_73 Q4_07_03

foreach var in Q4_07_01 Q4_07_02 Q4_07_03{
replace `var' = . if `var'==7
lab val `var' Q4_07
}
replace Q4_07_01 = 3 if P4_7_C7=="Abertura de processo disciplinar"
replace Q4_07_01 = 3 if P4_7_C7=="conversar com o professor para se corrigir o erro"
replace Q4_07_01 = 7 if P4_7_C7=="enviandoas faltas"
replace Q4_07_01 = 7 if P4_7_C7=="envio de faltas"
replace Q4_07_01 = 7 if P4_7_C7=="envio de faltas para desconto"
replace Q4_07_01 = 7 if P4_7_C7=="envio de mapas de falta"
replace Q4_07_01 = 7 if P4_7_C7=="reuni-los e envio de faltas"
replace Q4_07_01 = 3 if P4_7_C7=="reuni-los e sensibilizar"
replace Q4_07_01 = 3 if P4_7_C7=="reuniões alertando as desvantagens"

replace Q4_07_02 = 3 if P4_7_C7=="dialogo"
replace Q4_07_02 = 3 if P4_7_C7=="Processo disciplinar"
replace Q4_07_02 = 3 if P4_7_C7=="Reunir com o professor"
replace Q4_07_02 = 4 if P4_7_C7=="REPARTIÇAO"
replace Q4_07_02 = 7 if P4_7_C7=="aplicação de faltas"
replace Q4_07_02 = 7 if P4_7_C7=="Aplicação de faltas"
replace Q4_07_02 = 7 if P4_7_C7=="Aplicação de faltas"
replace Q4_07_02 = 7 if P4_7_C7=="aplicaçao de faltas"
replace Q4_07_02 = 7 if P4_7_C7=="envio de faltas para decontos"
replace Q4_07_02 = 7 if P4_7_C7=="marcar falta"
replace Q4_07_02 = 7 if P4_7_C7=="pelas faltas tÍm descontado valores de seu salario"

order P4_4_C5 P4_5_C9 P4_6_C9 P4_7_C7, after(Q4_07_03)

lab var P4_4_C5 "AUX"
lab var P4_5_C9 "AUX"
lab var P4_6_C9 "AUX"
lab var P4_7_C7 "AUX"
}
********************************************************************************
********************************** SECTION 5 ***********************************
********************************************************************************
{
lab var P5_1 "Someone of the school or ministry formally evaluates your performance"
rename P5_1 Q5_01
recode Q5_01 (2=0)
lab val Q5_01 dummy
replace Q5_01 = . if P5_2_C11=="n sabe"
replace Q5_01 = . if P5_2_C11=="não"
replace Q5_01 = . if P5_2_C11=="nao sabe"

lab var P5_201 "A. Observation in the classroom"
lab var P5_202 "B. Follow-up of the classifications in the exams of the students"
lab var P5_203 "C. Follow-up of the work developed by the students"
lab var P5_204 "D. Follow-up of student attendance"
lab var P5_205 "E. Interviews with school officials"
lab var P5_206 "F. Approval of the plans of the subject to be taught"
lab var P5_207 "G. Monitoring of daily teaching tasks"
lab var P5_208 "H. Follow-up of teachers' attendance"
lab var P5_209 "I. Follow-up of other staff records"
lab var P5_210 "J. Observation of parents' satisfaction with the performance of their children"
lab var P5_211 "K. Follow-up of the reports submitted"

foreach var in P5_201 P5_202 P5_203 P5_204 P5_205 P5_206 P5_207 P5_208 P5_209 P5_210 P5_211{
replace `var' = . if Q5_01==0
lab val `var' dummy
replace `var' = . if P5_2_C11=="n sabe"
replace `var' = . if P5_2_C11=="não"
replace `var' = . if P5_2_C11=="nao sabe"
}

replace P5_207 = 1 if P5_2_C11=="cumpr7mento do plano de trabalho"
replace P5_207 = 1 if P5_2_C11=="Cumprimento das actividades"
replace P5_207 = 1 if P5_2_C11=="cumprimento do programa"
replace P5_207 = 1 if P5_2_C11=="cumprimento do progrma"
replace P5_207 = 1 if P5_2_C11=="cumprimento dos deveres"
replace P5_207 = 1 if P5_2_C11=="cumprir o plano"
replace P5_207 = 1 if P5_2_C11=="planos de actividade"
replace P5_209 = 1 if P5_2_C11=="Atraves das fichas anuais preenchidas pelo coordenador escolar"
replace P5_211 = 0 if P5_211==1
replace P5_211 = 1 if P5_2_C11=="Acompanhamento dos orgão de apoio e processo Admnistrativo da escola"
replace P5_211 = 1 if P5_2_C11=="Entrega de estatisticas"
replace P5_211 = 1 if P5_2_C11=="Visitas e observação dos relatorios que apresentamos"
replace P5_211 = 1 if P5_2_C11=="Regualaridade de correspondencia"
replace P5_211 = 1 if P5_2_C11=="relações humanas"

rename P5_2(##) Q5_02_(##)

lab var P5_3_C1_P3 "A. Observation in the classroom"
lab var P5_3_C2_P3 "B. Follow-up of the classifications in the exams of the students"
lab var P5_3_C3_P3 "C. Follow-up of the work developed by the students"
lab var P5_3_C4_P3 "D. Follow-up of student attendance"
lab var P5_3_C5_P3 "E. Interviews with school officials"
lab var P5_3_C6_P3 "F. Approval of the plans of the subject to be taught"
lab var P5_3_C7_P3 "G. Monitoring of daily teaching tasks"
lab var P5_3_C8_P3 "H. Follow-up of teachers' attendance"
lab var P5_3_C9_P3 "I. Follow-up of other staff records"
lab var P5_3_C10_P3 "J. Observation of parents' satisfaction with the performance of their children"
lab var P5_3_C11_P3 "K. Follow-up of the reports submitted"

# delimit;
lab def Q5_03
1	"School director"
2	"School subdirector"
3	"Senior teacher"
4	"Other teacher"
5	"Representative of provincial education board"
6	"Representative of municipal education board"
7	"Representative of the ministry of education"
8	"School board"
9	"Other"
;
# delimit cr

** no specification for other **

foreach var in P5_3_C1_P3 P5_3_C2_P3 P5_3_C3_P3 P5_3_C4_P3 P5_3_C5_P3 P5_3_C6_P3 P5_3_C7_P3 P5_3_C8_P3 P5_3_C9_P3 P5_3_C10_P3 P5_3_C11_P3{
replace `var' = . if Q5_01==0
lab val `var' Q5_03
replace `var' = . if P5_2_C11=="n sabe"
replace `var' = . if P5_2_C11=="não"
replace `var' = . if P5_2_C11=="nao sabe"
recode `var' (7=8) (8=9)
}

replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="cumpr7mento do plano de trabalho"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="Cumprimento das actividades"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="cumprimento do programa"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="cumprimento do progrma"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="cumprimento dos deveres"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="cumprir o plano"
replace P5_3_C7_P3 = P5_3_C11_P3 if P5_2_C11=="planos de actividade"

replace P5_3_C9_P3 = P5_3_C11_P3 if P5_2_C11=="Atraves das fichas anuais preenchidas pelo coordenador escolar"

gen P5_3_C11_P3_x = .
replace P5_3_C11_P3_x = P5_3_C11_P3 if P5_2_C11=="Acompanhamento dos orgão de apoio e processo Admnistrativo da escola"
replace P5_3_C11_P3_x = P5_3_C11_P3 if P5_2_C11=="Entrega de estatisticas"
replace P5_3_C11_P3_x = P5_3_C11_P3 if P5_2_C11=="Visitas e observação dos relatorios que apresentamos"
replace P5_3_C11_P3_x = P5_3_C11_P3 if P5_2_C11=="Regualaridade de correspondencia"
replace P5_3_C11_P3_x = P5_3_C11_P3 if P5_2_C11=="relações humanas"
replace P5_3_C11_P3 = P5_3_C11_P3_x

drop P5_3_C11_P3_x

rename P5_3_C(#)_P3 Q5_03_0(#)
rename P5_3_C(##)_P3 Q5_03_(##)

lab var P5_4 "Number of days missed during the last two weeks"

lab var P5_4101 "Missed days because of own sickness"
lab var P5_4102 "Missed days because of sickness family member"
lab var P5_4103 "Missed days because of deatch family member"
lab var P5_4104 "Missed days because of other family emergency"
lab var P5_4105 "Missed days because of picking up salary in the village center"
lab var P5_4106 "Missed days to buy school supplies"
lab var P5_4107 "Missed days because of a workshop/training"
lab var P5_4108 "Missed days because of another reason related with the function"
lab var P5_4109 "Missed days because of second job"
lab var P5_4110 "Missed days because of unforseen circumstances such as rain"

rename P5_4 Q5_04
rename P5_41(##) Q5_04_(##)

foreach var in Q5_04_01 Q5_04_02 Q5_04_03 Q5_04_04 Q5_04_05 Q5_04_06 Q5_04_07 Q5_04_08 Q5_04_09 Q5_04_10{
replace `var' = . if Q5_04==0
lab val `var' dummy
}

replace Q5_04_10 = .
replace Q5_04_10 = 0 if inlist(Q5_04,1,2,3,4,5,6,7)
replace Q5_04_10 = 1 if P5_41_C10=="Chuva"
replace Q5_04_10 = 1 if P5_41_C10=="Chuvas"
replace Q5_04_10 = 1 if P5_41_C10=="nao teve transporte para ir a escola"


gen Q5_04_11 = 0 if inlist(Q5_04,1,2,3,4,5,6,7)
lab var Q5_04_11 "Missed days because of another personal reason"
replace Q5_04_11 = 1 if P5_41_C10=="Entrega de documentos"
replace Q5_04_11 = 1 if P5_41_C10=="Festa familiar"
order Q5_04_11, after(Q5_04_10)
lab val Q5_04_11 dummy

egen tot = rowtotal(Q5_04_01 Q5_04_02 Q5_04_03 Q5_04_04 Q5_04_05 Q5_04_06 Q5_04_07 Q5_04_08 Q5_04_09 Q5_04_10 Q5_04_11), missing
foreach var in Q5_04_01 Q5_04_02 Q5_04_03 Q5_04_04 Q5_04_05 Q5_04_06 Q5_04_07 Q5_04_08 Q5_04_09 Q5_04_10 Q5_04_11{
replace `var' = . if tot==0
}
drop tot

lab var P5_56_C1_P5_5 "Number of days missed because of own sickness"
lab var P5_56_C2_P5_5 "Number of days missed because of sickness family member"
lab var P5_56_C3_P5_5 "Number of days missed because of deatch family member"
lab var P5_56_C4_P5_5 "Number of days missed because of other family emergency"
lab var P5_56_C5_P5_5 "Number of days missed because of picking up salary in the village center"
lab var P5_56_C6_P5_5 "Number of days missed to buy school supplies"
lab var P5_56_C7_P5_5 "Number of days missed because of a workshop/training"
lab var P5_56_C8_P5_5 "Number of days missed because of another reason related with the function"
lab var P5_56_C9_P5_5 "Number of days missed because of second job"
lab var P5_56_C10_P5_5 "Number of days missed because of unforseen circumstances such as rain"

rename P5_56_C(#)_P5_5 Q5_05_0(#)
rename P5_56_C(##)_P5_5 Q5_05_(##)

foreach var in Q5_05_01 Q5_05_02 Q5_05_03 Q5_05_04 Q5_05_05 Q5_05_06 Q5_05_07 Q5_05_08 Q5_05_09 Q5_05_10{
replace `var' = . if Q5_04==0
}

gen Q5_05_11 = Q5_05_10 if P5_41_C10=="Entrega de documentos"
replace Q5_05_11 = Q5_05_10 if P5_41_C10=="Festa familiar"
lab var Q5_05_11 "Number of days missed because of another personal reason"

gen Q5_05_10x = .
replace Q5_05_10x = Q5_05_10 if P5_41_C10=="Chuva"
replace Q5_05_10x = Q5_05_10 if P5_41_C10=="Chuvas"
replace Q5_05_10x = Q5_05_10 if P5_41_C10=="nao teve transporte para ir a escola"
replace Q5_05_10 = Q5_05_10x
drop Q5_05_10x

order Q5_05_11, after(Q5_05_10)

forval n=1/9{
replace Q5_05_0`n' = . if Q5_04_0`n'!=1
}
replace Q5_05_10 = . if Q5_04_10!=1
replace Q5_05_11 = . if Q5_04_11!=1

lab var P5_56_C1_P5_6 "Absence approved in case of own sickness"
lab var P5_56_C2_P5_6 "Absence approved in case of sickness family member"
lab var P5_56_C3_P5_6 "Absence approved in case of deatch family member"
lab var P5_56_C4_P5_6 "Absence approved in case of other family emergency"
lab var P5_56_C5_P5_6 "Absence approved in case of picking up salary in the village center"
lab var P5_56_C6_P5_6 "Absence approved to buy school supplies"
lab var P5_56_C7_P5_6 "Absence approved in case of a workshop/training"
lab var P5_56_C8_P5_6 "Absence approved in case of another reason related with the function"
lab var P5_56_C9_P5_6 "Absence approved in case of second job"
lab var P5_56_C10_P5_6 "Absence approved in case of unforseen circumstances such as rain or transport"

rename P5_56_C(#)_P5_6 Q5_06_0(#)
rename P5_56_C(##)_P5_6 Q5_06_(##)

foreach var in Q5_06_01 Q5_06_02 Q5_06_03 Q5_06_04 Q5_06_05 Q5_06_06 Q5_06_07 Q5_06_08 Q5_06_09 Q5_06_10{
replace `var' = . if Q5_04==0
recode `var' (2=0)
lab val `var' dummy
}

gen Q5_06_11 = Q5_06_10 if P5_41_C10=="Entrega de documentos"
replace Q5_06_11 = Q5_06_10 if P5_41_C10=="Festa familiar"
lab var Q5_06_11 "Absence approved in case of another personal reason"

gen Q5_06_10x = 0 if Q5_04_10==1
replace Q5_06_10x = Q5_06_10 if P5_41_C10=="Chuva"
replace Q5_06_10x = Q5_06_10 if P5_41_C10=="Chuvas"
replace Q5_06_10x = Q5_06_10 if P5_41_C10=="nao teve transporte para ir a escola"
replace Q5_06_10 = Q5_06_10x
drop Q5_06_10x

order Q5_06_11, after(Q5_06_10)
order P5_2_C11 P5_41_C10, after(Q5_06_11)

lab var P5_2_C11 "AUX"
lab var P5_41_C10 "AUX"
}
********************************************************************************
********************************** SECTION 6 ***********************************
********************************************************************************
{
lab var P6_1 "Number of times in days a representative of the provincial direction of education visited the school last year (2013)"
lab var P6_2 "Number of times in days a representative of the school was asked to come to the provincial direction of education last year (2013)"
rename P6_1 Q6_01
rename P6_2 Q6_02

lab var P6_3_0_C1 "Last meeting with a representative of the provincial direction of education (month)"
lab var P6_3_0_C2 "Last meeting with a representative of the provincial direction of education (year)"
rename P6_3_0_C1 Q6_03_month
rename P6_3_0_C2 Q6_03_year
replace Q6_03_month = . if Q6_03_month==0
replace Q6_03_year = . if inlist(Q6_03_year,0,30)

lab var P6_4 "Last meeting with a representative of the provincial direction of education (reason)"
rename P6_4 Q6_04
replace Q6_04 = . if inlist(Q6_04,8,9,10)

replace Q6_04 = 1 if P6_4_Other=="Efectividade"
replace Q6_04 = 1 if P6_4_Other=="Entrega de expediente"
replace Q6_04 = 1 if P6_4_Other=="Esclarecimentos"
replace Q6_04 = 1 if P6_4_Other=="Estatisticas"
replace Q6_04 = 1 if P6_4_Other=="Reunião de balanço"
replace Q6_04 = 1 if P6_4_Other=="Reuniao de estatistica"
replace Q6_04 = 1 if P6_4_Other=="reuniaode esclarecimento"
replace Q6_04 = 2 if P6_4_Other=="seminario"
replace Q6_04 = 3 if P6_4_Other=="Cnselho consulivo da educação"
replace Q6_04 = 3 if P6_4_Other=="conselho consultivo"
replace Q6_04 = 3 if P6_4_Other=="Conselho consultivo municipal"
replace Q6_04 = 3 if P6_4_Other=="orientações gerais"
replace Q6_04 = 3 if P6_4_Other=="Reuniãobao nÌvel do municÌpio"
replace Q6_04 = 5 if P6_4_Other=="RECEBER DOC DA REFORMA DE UMA COLEGA"
replace Q6_04 = 5 if P6_4_Other=="Planificação"
replace Q6_04 = 6 if P6_4_Other=="funcionamento e comportamento e transferencias, nomeacoes"
replace Q6_04 = 6 if P6_4_Other=="inauguração"
replace Q6_04 = 6 if P6_4_Other=="inspessão sobre as provas do professor"
replace Q6_04 = 6 if P6_4_Other=="Levantar material"

# delimit;
lab def Q6_04
1	"School inspection"
2	"Training/workshop/seminar"
3	"Meeting at the provincial/village level"
4	"Pedagogical meeting"
5	"Meeting about structural planning"
6	"Meeting about other topics related to school"
7	"Informal/social meeting"
;
lab val Q6_04 Q6_04;
# delimit cr

lab var P6_5 "Respondent had to report to the provincial direction of education during last year (2013)"
rename P6_5 Q6_05
recode Q6_05 (2=0)
lab val Q6_05 dummy
replace Q6_05=0 if P6_6_C10=="Nenhum"

lab var P6_601 "Reported about enrollment numbers"
lab var P6_602 "Reported about assiduity of the students"
lab var P6_603 "Reported about assiduity of the professors"
lab var P6_604 "Reported about books"
lab var P6_605 "Reported about furniture"
lab var P6_606 "Reported about other resources"
lab var P6_607 "Reported about the class sizes"
lab var P6_608 "Reported about the classrooms"
lab var P6_609 "Reported about year plan of the school"
lab var P6_610 "Reported about minutes of meetings"

rename P6_6(##) Q6_06_(##)_a

foreach var in Q6_06_01_a Q6_06_02_a Q6_06_03_a Q6_06_04_a Q6_06_05_a Q6_06_06_a Q6_06_07_a Q6_06_08_a Q6_06_09_a Q6_06_10_a{
replace `var' = . if Q6_05==0
lab val `var' dummy
}

replace Q6_06_10_a = .
replace Q6_06_10_a = 0 if Q6_05==1
replace Q6_06_02_a = 1 if P6_6_C10=="estatistica, desemponho das alunos"
replace Q6_06_03_a = 1 if P6_6_C10=="falta de professores"
replace Q6_06_06_a = 1 if P6_6_C10=="Balanço do 22 de Novembro"
replace Q6_06_09_a = 1 if P6_6_C10=="desenrrolar das actividades de caracter pedagógico"
replace Q6_06_10_a = 1 if P6_6_C10=="atas"

egen tot = rowtotal(Q6_06_01_a Q6_06_02_a Q6_06_03_a Q6_06_04_a Q6_06_05_a Q6_06_06_a Q6_06_07_a Q6_06_08_a Q6_06_09_a Q6_06_10_a), missing
foreach var in Q6_06_01_a Q6_06_02_a Q6_06_03_a Q6_06_04_a Q6_06_05_a Q6_06_06_a Q6_06_07_a Q6_06_08_a Q6_06_09_a Q6_06_10_a{
replace `var' = . if tot==0
}
drop tot

lab var P6_61_C1_Nenvios "Number of reports about enrollment numbers"
lab var P6_61_C2_Nenvios "Number of reports about assiduity of the students"
lab var P6_61_C3_Nenvios "Number of reports about assiduity of the professors"
lab var P6_61_C4_Nenvios "Number of reports about books"
lab var P6_61_C5_Nenvios "Number of reports about furniture"
lab var P6_61_C6_Nenvios "Number of reports about other resources"
lab var P6_61_C7_Nenvios "Number of reports about the class sizes"
lab var P6_61_C8_Nenvios "Number of reports about the classrooms"
lab var P6_61_C9_Nenvios "Number of reports about year plan of the school"
lab var P6_61_C10_Nenvios "Number of reports about minutes of meetings"

rename P6_61_C(#)_Nenvios Q6_06_0(#)_b
rename P6_61_C(##)_Nenvios Q6_06_(##)_b

foreach var in Q6_06_01_b Q6_06_02_b Q6_06_03_b Q6_06_04_b Q6_06_05_b Q6_06_06_b Q6_06_07_b Q6_06_08_b Q6_06_09_b Q6_06_10_b{
replace `var' = . if `var'==0
}

replace Q6_06_02_b = Q6_06_10_b if P6_6_C10=="estatistica, desemponho das alunos"
replace Q6_06_03_b = Q6_06_10_b if P6_6_C10=="falta de professores"
replace Q6_06_06_b = Q6_06_10_b if P6_6_C10=="Balanço do 22 de Novembro"
replace Q6_06_09_b = Q6_06_10_b if P6_6_C10=="desenrrolar das actividades de caracter pedagógico"

gen Q6_06_10_bx = Q6_06_10_b if P6_6_C10=="atas"
replace Q6_06_10_b = Q6_06_10_bx
drop Q6_06_10_bx

lab var P6_7 "Classification of relation with provincial direction of education"
rename P6_7 Q6_07
replace Q6_07 = . if Q6_07==4

#delimit;
lab def Q6_07
1	"Good"
2	"Satisfactory"
3	"Bad"
;
lab val Q6_07 Q6_07;
# delimit cr

drop P6_81 P6_82 P6_83

lab var P6_8_C1 "Reason why bad relation (1)"
lab var P6_8_C2 "Reason why bad relation (2)"
lab var P6_8_C3 "Reason why bad relation (3)"
rename P6_8_C* Q6_08_0*
}
********************************************************************************
********************************** SECTION 7 ***********************************
********************************************************************************
{
lab var P7_1 "Regular meetings between professors and parents"
lab var P7_2 "Parents can come talk to the respondent about problems with professors, direction or school management"

rename P7_1 Q7_01
rename P7_2 Q7_02
recode Q7_01 (2=0)
recode Q7_02 (2=0)
lab val Q7_01 Q7_02 dummy

lab var P7_31 "If parent complains about teachers teaching methods: speak with teacher"
lab var P7_32 "If parent complains about teachers teaching methods: closely follow behavior of teacher"
lab var P7_33 "If parent complains about teachers teaching methods: do nothing until more complaints"
lab var P7_34 "If parent complains about teachers teaching methods: nothing I can do"
lab var P7_35 "If parent complains about teachers teaching methods: nothing, parents are not qualified to complain about that"
lab var P7_36 "If parent complains about teachers teaching methods: taking note but nothing else"

replace P7_31 = 1 if P7_3_C6=="converssa com o professor e o pai"
replace P7_31 = 1 if P7_3_C6=="falar com o professor para rever os metodos de ensino"
replace P7_31 = 1 if P7_3_C6=="reforçar as reunioes metodologicas"
replace P7_31 = 1 if P7_3_C6=="Reunia com o professor"
replace P7_31 = 1 if P7_3_C6=="reuniao para escutar ambas as partes"
replace P7_32 = 1 if P7_3_C6=="ver o desempenh doprofessor"
replace P7_32 = 1 if P7_3_C6=="ver quem é o encarregado de educação e acompanhar o professor"
replace P7_36 = 0
replace P7_36 = 1 if P7_3_C6=="anotar a procupaçao dos pais"
replace P7_36 = 1 if P7_3_C6=="ouvir o encarragado, analizar com o control pedagógico"
replace P7_36 = 1 if P7_3_C6=="sensibilizava o encarregado"

rename P7_3(#) Q7_03_0(#)

lab var P7_41 "If parent complains about teachers displinary methods: speak with teacher"
lab var P7_42 "If parent complains about teachers displinary methods: closely follow behavior of teacher"
lab var P7_43 "If parent complains about teachers displinary methods: do nothing until more complaints"
lab var P7_44 "If parent complains about teachers displinary methods: nothing I can do"
lab var P7_45 "If parent complains about teachers displinary methods: nothing, parents are not qualified to complain about that"
lab var P7_46 "If parent complains about teachers displinary methods: start displinary process against professor"

replace P7_41 = 1 if P7_4_C6=="aconselhar o professor a não voltar a fazer"
replace P7_41 = 1 if P7_4_C6=="chamar a atençao do professor"
replace P7_41 = 1 if P7_4_C6=="Cumpria com os decretos para ver o enquadramento do professor"
replace P7_41 = 1 if P7_4_C6=="falar com o professor para adotar outras medidas de ensino"
replace P7_41 = 1 if P7_4_C6=="sencibilizar o professor"
replace P7_42 = 1 if P7_4_C6=="supervisionar o professor e falar com o pai"
replace P7_43 = 1 if P7_4_C6=="apurar os factos"
replace P7_46 = 0
replace P7_46 = 1 if P7_4_C6=="depois da confirmação levantariam um processo disciplinar contra o professor"
replace P7_46 = 1 if P7_4_C6=="Regularizar junto a comissão a situação do professor"
replace P7_46 = 1 if P7_4_C6=="sansionar o professor"

rename P7_4(#) Q7_04_0(#)

lab var P7_51 "If parent complains about teachers asking money for private classes: speak with teacher"
lab var P7_52 "If parent complains about teachers asking money for private classes: closely follow behavior of teacher"
lab var P7_53 "If parent complains about teachers asking money for private classes: do nothing until more complaints"
lab var P7_54 "If parent complains about teachers asking money for private classes: nothing I can do"
lab var P7_55 "If parent complains about teachers asking money for private classes: start displinary process against professor"

replace P7_51 = 1 if P7_5_C5=="aconselhar o professor a deixar esta pratica"
replace P7_51 = 1 if P7_5_C5=="repreender o professor"

replace P7_55 = 0
replace P7_55 = 1 if P7_5_C5=="anular acobransa"
replace P7_55 = 1 if P7_5_C5=="Constituia um processo disciplinar"
replace P7_55 = 1 if P7_5_C5=="faze participação do professor"
replace P7_55 = 1 if P7_5_C5=="Fazer uma informação a repartição"
replace P7_55 = 1 if P7_5_C5=="informar a direção municipal"
replace P7_55 = 1 if P7_5_C5=="informava o professor na pepartiçao fiscal"
replace P7_55 = 1 if P7_5_C5=="Instaura-se um processo disciplinar"
replace P7_55 = 1 if P7_5_C5=="junto da repartiçãolidariam com o professor"
replace P7_55 = 1 if P7_5_C5=="sansão pelo professor"

gen P7_56 = 0
replace P7_56 = 1 if P7_5_C5=="Junto a Direção de escola avaliavam e resolvia a situação"
replace P7_56 = 1 if P7_5_C5=="procurar provas para poder avaliar o professor"
replace P7_56 = 1 if P7_5_C5=="reunir o conselho da direção e analizar a questão"
replace P7_56 = 1 if P7_5_C5=="saber de ondetirou tal orientação"
replace P7_56 = 1 if P7_5_C5=="vereficar a veracidade dos factos"

lab var P7_56 "If parent complains about teachers asking money for private classes: analyse the situation better"
rename P7_5(#) Q7_05_0(#)

order Q7_05_06, after(Q7_05_05)

lab val Q7_03_* Q7_04_* Q7_05_* dummy

order P7_3_C6 P7_4_C6 P7_5_C5, after(Q7_05_06)

lab var P7_3_C6 "AUX"
lab var P7_4_C6 "AUX"
lab var P7_5_C5 "AUX"

}
********************************************************************************
********************************** SECTION 8 ***********************************
********************************************************************************
{
lab var P8_1 "How are the teacher representatives nominated for the school board?"
lab var P8_2 "How are the parent representatives nominated for the school board?"

#delimit
lab def Q8_01
1	"Elected by all teachers"
2	"Nominated by the school direction/director"
3	"They are the same as the year before"
4	"Nominated by the village direction"
;
lab def Q8_02
1	"Elected by the parents committee"
2	"Elected by all parents"
3	"Nominated by the school direction/director"
4	"Nominated by the teachers"
5	"They are the same as the year before"
6	"Nominated by community leaders"
;
#delimit cr

rename P8_1 Q8_01
rename P8_2 Q8_02

replace Q8_01 = . if inlist(Q8_01,4,5)
replace Q8_01 = 2 if P8_1_C4=="encontro de conselho de direçao"
replace Q8_01 = 2 if P8_1_C4=="indicados pelo director"
replace Q8_01 = 2 if P8_1_C4=="Sao indicados"
replace Q8_01 = 4 if P8_1_C4=="por conta da direcção municipal"

replace Q8_02 = . if inlist(Q8_02,6,7)
replace Q8_02 = 1 if P8_2_Other=="Conselho de auscutação"
replace Q8_02 = 3 if P8_2_Other=="Pelo coordenador escolar"
replace Q8_02 = 2 if P8_2_Other=="eleitos pela comunidade"
replace Q8_02 = 3 if P8_2_Other=="em asembleia de escola"
replace Q8_02 = 6 if P8_2_Other=="sao indicdos pelos lideres do bairro"
replace Q8_02 = 6 if P8_2_Other=="através de uma assembleia de pais encarregados de educação"

lab val Q8_01 Q8_01
lab val Q8_02 Q8_02

lab var P8_31 "Main responsibilities of the school direction (1)"
lab var P8_32 "Main responsibilities of the school direction (2)"
lab var P8_33 "Main responsibilities of the school direction (3)"
lab var P8_34 "Main responsibilities of the school direction (4)"
lab var P8_35 "Main responsibilities of the school direction (5)"

#delimit
lab def Q8_03
1	"Decide how the money made available to the school by the state is spent"
2	"Prepare school development plan"
3	"Talk to parents / guardians about student commitment"
4	"Talk to teachers about their commitment"
5	"Discuss the possibility of dismissing a teacher"
6	"Report school problems to higher levels"
7	"Gather money and / or community materials"
8	"Suggest changes to what is taught at school"
9	"Suggest changes to the way of teaching"
10	"Discuss issues presented by parents / guardians"
11	"Discuss issues presented by teachers"
12	"Supervise and manage work teachers and in general"
;
#delimit cr

rename P8_3(#) Q8_03_0(#)

forval n=1/5{
replace Q8_03_0`n' = . if inlist(Q8_03_0`n',12,13)
}

replace Q8_03_01 = 2 if P8_3_C12=="programar actividades, dirigir, contralar, avaliar, supervisionar"
replace Q8_03_01 = 12 if P8_3_C12=="controlar as actividades da escola"
replace Q8_03_01 = 12 if P8_3_C12=="controlo, ditribuição de taefas"
replace Q8_03_01 = 12 if P8_3_C12=="dirigir e assegurar o funcionamento da escola."
replace Q8_03_01 = 12 if P8_3_C12=="dirigir, organizar e fazer cumrir a lei das normas do ministerio"
replace Q8_03_01 = 12 if P8_3_C12=="gestão da escola, velar  pela vida da escola"
replace Q8_03_01 = 12 if P8_3_C12=="verificar o trabalho dos professorea"

replace Q8_03_02 = 10 if P8_3_C12=="Manter o expediente"
replace Q8_03_02 = 12 if P8_3_C12=="assiduidade por arte da diração da escola"
replace Q8_03_02 = 12 if P8_3_C12=="criatividade dos professores, boa relação com os colegas, relação professor/aluno, contolar o desempenho dos professores"
replace Q8_03_02 = 12 if P8_3_C12=="Matriculas dos alunos, verificar as quantidades dos aluno, verificarcquantidade dos alunos"

replace Q8_03_03 = 12 if P8_3_C12=="controlar todas actividades"
replace Q8_03_03 = 12 if P8_3_C12=="Materias de trabalho"
replace Q8_03_03 = 12 if P8_3_C12=="organização da estrutura"
replace Q8_03_03 = 12 if P8_3_C12=="manter o dinamismo da escola"
replace Q8_03_03 = 12 if P8_3_C12=="Manutenção das infraestruturas"
replace Q8_03_03 = 12 if P8_3_C12=="Velar pela organização da escola"

replace Q8_03_04 = 10 if P8_3_C12=="Criar proximidade entre comunidade e a escola"
replace Q8_03_04 = 12 if P8_3_C12=="cumprir e fazer cumprir todas orientações emanadas supriormente"
replace Q8_03_04 = 12 if P8_3_C12=="gestão da escola"
replace Q8_03_04 = 12 if P8_3_C12=="manter a organização escolar"
replace Q8_03_04 = 10 if P8_3_C12=="Organizar expediente"
replace Q8_03_04 = 12 if P8_3_C12=="providenciar materiais"
replace Q8_03_04 = 12 if P8_3_C12=="sensibilização dos professores"
replace Q8_03_04 = 12 if P8_3_C12=="Velar a estrutura"

replace Q8_03_05 = 12 if P8_3_C12=="gestao da instituiçao,"
replace Q8_03_05 = 12 if P8_3_C12=="Reunir com todas os elenentos que fazem parte direcçao da escola"
replace Q8_03_05 = 12 if P8_3_C12=="zelar pelo alunos, professores e pela escola"

lab val Q8_03_01 Q8_03_02 Q8_03_03 Q8_03_04 Q8_03_05 Q8_03

lab var P8_4 "Performance of the school leadership, given the responsibilities"

#delimit
lab def Q8_04
1	"Very good"
2	"Good"
3	"Average"
4	"Bad"
5	"Very bad"
;
#delimit cr

rename P8_4 Q8_04
lab val Q8_04 Q8_04

** no observations for P8_5 since nothing bad in P8_4

lab var P8_51 "NO OBS"
lab var P8_52 "NO OBS"
lab var P8_53 "NO OBS"

rename P8_5(#) Q8_05_0(#)

drop P8_5_C1 P8_5_C2 P8_5_C3

lab var P8_6 "How often does school management meet during a regular school year?"
#delimit
lab def Q8_06
1	"More than once per month"
2	"Once per month"
3	"Once in two months"
4	"Once in three months"
5	"Once every six months"
6	"Once per year"
;
#delimit cr
rename P8_6 Q8_06
replace Q8_06 = . if inlist(Q8_06,6,7)
replace Q8_06 = 2 if P8_6_C6=="2 meses"
replace Q8_06 = 1 if P8_6_C6=="2vezes por trimestre"
replace Q8_06 = 0 if P8_6_C6=="3 vezes por mÍs"
replace Q8_06 = 3 if P8_6_C6=="4"
replace Q8_06 = 4 if P8_6_C6=="6"
replace Q8_06 = 0 if P8_6_C6=="4 por mÍs"
replace Q8_06 = 1 if P8_6_C6=="DUAS VEZES EM 3 MESES"
replace Q8_06 = Q8_06+1

lab val Q8_06 Q8_06

lab var P8_7 "Are you a member of the school board?"
rename P8_7 Q8_07
recode Q8_07 (2=0)
lab val Q8_07 dummy

lab var P8_8 "Are you allowed to attend school board meetings, even if you are not a member?"
rename P8_8 Q8_08
recode Q8_08 (2=0)
lab val Q8_08 dummy


lab var P8_9 "Usually attends school board meetings"
rename P8_9 Q8_09
recode Q8_09 (2=0)
lab val Q8_09 dummy


lab var P8_10 "You can express your opinions and vote on issues discussed during the meetings."
#delimit
lab def Q8_10
1	"Yes, I can express my opinion and vote"
2	"I can express my opinion, but I can not vote"
3	"No, I can not speak or vote."
4	"Not applicable / I do not attend meetings"
;
#delimit cr
rename P8_10 Q8_10
lab val Q8_10 Q8_10


lab var P8_11 "Working relationship classification with the school board"
#delimit
lab def Q8_11
1	"Good"
2	"Satisfactory"
3	"Bad"
;
#delimit cr
rename P8_11 Q8_11
replace Q8_11 = . if Q8_11==4
lab val Q8_11 Q8_11


** no observations for P8_12 since nothing bad in P8_11

lab var P8_121 "NO OBS"
lab var P8_122 "NO OBS"
lab var P8_123 "NO OBS"
rename P8_12(#) Q8_12_0(#)
drop P8_12_C1 P8_12_C2 P8_12_C3

order P8_1_C4 P8_2_Other P8_3_C12 P8_6_C6, after(Q8_12_03)
lab var P8_1_C4 "AUX"
lab var P8_2_Other "AUX"
lab var P8_3_C12 "AUX"
lab var P8_6_C6 "AUX"
}
********************************************************************************
********************************** SECTION 9 ***********************************
********************************************************************************
{
lab var P9_1A "First most important accomplishment achieved by this school last year (2013)"
lab var P9_1B "Second most important accomplishment achieved by this school last year (2013)"
lab var P9_1C "Third most important accomplishment achieved by this school last year (2013)"

rename P9_1A Q9_01
rename P9_1B Q9_02
rename P9_1C Q9_03

lab var P9_1A_C80 "AUX"
lab var P9_1B_C81 "AUX"
lab var P9_1C_C82 "AUX"

lab var P9_Loop_C1_Q1 "Classes with too many students"
lab var P9_Loop_C2_Q1 "Quality of classrooms"
lab var P9_Loop_C3_Q1 "Sanitary installations"
lab var P9_Loop_C4_Q1 "Poor health of students"
lab var P9_Loop_C5_Q1 "Failure to comply with schedules by students"
lab var P9_Loop_C6_Q1 "Absences from students"
lab var P9_Loop_C7_Q1 "Dropout rate"
lab var P9_Loop_C8_Q1 "Disordered conduct or physical conflict among students"
lab var P9_Loop_C9_Q1 "Appreciation of students towards teachers"
lab var P9_Loop_C10_Q1 "Disrespect of students towards teachers"
lab var P9_Loop_C11_Q1 "Lack of parent involvement in school"
lab var P9_Loop_C12_Q1 "Insufficient number of teachers"
lab var P9_Loop_C13_Q1 "Preparation of school staff"
lab var P9_Loop_C14_Q1 "Absenteeism of teachers"
lab var P9_Loop_C15_Q1 "Teachers' failure to meet schedules"
lab var P9_Loop_C16_Q1 "Teacher salaries are too low"
lab var P9_Loop_C17_Q1 "Teacher evaluation"
lab var P9_Loop_C18_Q1 "Motivation of teachers"
lab var P9_Loop_C19_Q1 "The school budget is not enough"
lab var P9_Loop_C20_Q1 "Teachers give private lessons to students of their own class"
lab var P9_Loop_C21_Q1 "Teachers give private lessons to students in other classes"
lab var P9_Loop_C22_Q1 "Lack of teaching material"
lab var P9_Loop_C23_Q1 "Cost of guaranteeing materials for students"
lab var P9_Loop_C24_Q1 "Automatic passage of children to the next class, even without use"
lab var P9_Loop_C25_Q1 "Specific agenda items"
lab var P9_Loop_C26_Q1 "Extracurricular activities"
lab var P9_30 "AUX"
lab var P9_30_Codes "AUX"

rename P9_Loop_C1_Q1 Q9_04
rename P9_Loop_C2_Q1 Q9_05
rename P9_Loop_C3_Q1 Q9_06
rename P9_Loop_C4_Q1 Q9_07
rename P9_Loop_C5_Q1 Q9_08
rename P9_Loop_C6_Q1 Q9_09
rename P9_Loop_C7_Q1 Q9_10
rename P9_Loop_C8_Q1 Q9_11
rename P9_Loop_C9_Q1 Q9_12
rename P9_Loop_C10_Q1 Q9_13
rename P9_Loop_C11_Q1 Q9_14
rename P9_Loop_C12_Q1 Q9_15
rename P9_Loop_C13_Q1 Q9_16
rename P9_Loop_C14_Q1 Q9_17
rename P9_Loop_C15_Q1 Q9_18
rename P9_Loop_C16_Q1 Q9_19
rename P9_Loop_C17_Q1 Q9_20
rename P9_Loop_C18_Q1 Q9_21
rename P9_Loop_C19_Q1 Q9_22
rename P9_Loop_C20_Q1 Q9_23
rename P9_Loop_C21_Q1 Q9_24
rename P9_Loop_C22_Q1 Q9_25
rename P9_Loop_C23_Q1 Q9_26
rename P9_Loop_C24_Q1 Q9_27
rename P9_Loop_C25_Q1 Q9_28
rename P9_Loop_C26_Q1 Q9_29

#delimit
lab def Q9_part1
1	"Build / improve classrooms"
2	"Build / improve sanitary facilities"
3	"Build / improve other facilities (eg multipurpose field, library, cafeteria ...)"
4	"Encourage extracurricular activities (for example: football championships between schools)"
5	"Improve the results achieved in the final exams"
6	"Improve student performance at all levels"
7	"Reducing the dropout rate"
8 	"Reduce teacher absenteeism"
9 	"Improve student assiduity"
10	"Improving teacher assiduity"
11	"Improving the conditions offered to teachers (salaries, accommodation near the school and / or ease of transportation)"
12	"Improving materials/furniture/teaching methods"
13	"Improving administration"
14	"More teachers"
15	"More students/classes"
16	"Interpersonal relations"
17	"Parental involvement"
;
lab def Q9_part2
0	"Not a problem"
1	"Small problem"
2	"Average problem"
3	"Big problem"
;
lab val Q9_01 Q9_02 Q9_03 Q9_part1;
lab val Q9_04 Q9_05 Q9_06 Q9_07 Q9_08 Q9_09 Q9_10 Q9_11 Q9_12 Q9_13 Q9_14 Q9_15 Q9_16 Q9_17 Q9_18 Q9_19 Q9_20 Q9_21 Q9_22 Q9_23 Q9_24 Q9_25 Q9_26 Q9_27 Q9_28 Q9_29 Q9_part2;
#delimit cr

replace Q9_01 = . if inlist(Q9_01,12,13)
replace Q9_01 = 3 if P9_1A_C80=="Construção de uma vedação"
replace Q9_01 = 3 if P9_1A_C80=="construçao do Jango"
replace Q9_01 = 3 if P9_1A_C80=="jornada pedagogica e abertura da oficina pedagogica"
replace Q9_01 = 3 if P9_1A_C80=="vedação"
replace Q9_01 = 6 if P9_1A_C80=="bom aproveitamento dos alunos"
replace Q9_01 = 6 if P9_1A_C80=="obnumero aluno que transiaram de classe, bom desempenho dos professores"
replace Q9_01 = 12 if P9_1A_C80=="a escola recebeu carteiras"
replace Q9_01 = 12 if P9_1A_C80=="Apoio com o material de apoio"
replace Q9_01 = 12 if P9_1A_C80=="aquisição de carimbo"
replace Q9_01 = 12 if P9_1A_C80=="contratação de uma empregada de limpesa"
replace Q9_01 = 12 if P9_1A_C80=="Inovar os métodos ensino (aulas audiovisuais)"
replace Q9_01 = 12 if P9_1A_C80=="materiais"
replace Q9_01 = 12 if P9_1A_C80=="melhoramento do mobiliario"
replace Q9_01 = 12 if P9_1A_C80=="melhoria no gabinete"
replace Q9_01 = 12 if P9_1A_C80=="Melhoria no material didactico"
replace Q9_01 = 12 if P9_1A_C80=="melhoria no mobiliario escolar"
replace Q9_01 = 12 if P9_1A_C80=="merenda escolar"
replace Q9_01 = 13 if P9_1A_C80=="enquadraram 250 alunos que estavam fora do sistema de ensino"
replace Q9_01 = 13 if P9_1A_C80=="melhoria do processo docente, qualidade de ensino"
replace Q9_01 = 13 if P9_1A_C80=="Melhoria na prganização de processos"
replace Q9_01 = 13 if P9_1A_C80=="os planos de actividades e o seu comprimento."
replace Q9_01 = 14 if P9_1A_C80=="Aumento de professores"
replace Q9_01 = 14 if P9_1A_C80=="Capacitação dos professores"
replace Q9_01 = 15 if P9_1A_C80=="Aumento de alunos matriculados"
replace Q9_01 = 15 if P9_1A_C80=="existencia da 7™classe"
replace Q9_01 = 16 if P9_1A_C80=="Melhorar a relação com a comunidade"
replace Q9_01 = 16 if P9_1A_C80=="Melhorar a relação inter pessoal"
replace Q9_01 = 16 if P9_1A_C80=="Melhorou a relação entre colegas"

replace Q9_02 = . if inlist(Q9_02,12,13)
replace Q9_02 = 1 if P9_1B_C81=="construção de mais uma sala de aulas de caracter provisório"
replace Q9_02 = 1 if P9_1B_C81=="CONTRUIU DUAS SALAS PROVISORIA"
replace Q9_02 = 2 if P9_1B_C81=="atividade que visou a construçao e uso de latrinas"
replace Q9_02 = 2 if P9_1B_C81=="visitas da administração com a promeça da reabitação das instalações sanitárias"
replace Q9_02 = 3 if P9_1B_C81=="Canalização de água potavel"
replace Q9_02 = 3 if P9_1B_C81=="Construção da vedação"
replace Q9_02 = 3 if P9_1B_C81=="reabilitaçao do gabinete do diretor"
replace Q9_02 = 4 if P9_1B_C81=="concretização de actividades extra escolares"
replace Q9_02 = 10 if P9_1B_C81=="desempenho dos docentes"
replace Q9_02 = 10 if P9_1B_C81=="Empenho dos docentes"
replace Q9_02 = 10 if P9_1B_C81=="participação em seminarios por parte dos professores"
replace Q9_02 = 10 if P9_1B_C81=="participaçaovativa dos professores na reuniao do conselho pedagogico"
replace Q9_02 = 12 if P9_1B_C81=="a escola recebeu material de escritório"
replace Q9_02 = 12 if P9_1B_C81=="Apetrechamentos das salas de aulas"
replace Q9_02 = 12 if P9_1B_C81=="Máquina de dactilografar e aquisição de um gerador, televi~soa"
replace Q9_02 = 12 if P9_1B_C81=="merenda escolar"
replace Q9_02 = 13 if P9_1B_C81=="Melhoria Arquivo escolar"
replace Q9_02 = 16 if P9_1B_C81=="boa colaboraçao da comunidade"
replace Q9_02 = 16 if P9_1B_C81=="boa interação entre escola, comunidade"
replace Q9_02 = 17 if P9_1B_C81=="envolvimento dos encarregados"

replace Q9_03 = . if inlist(Q9_03,12,13)
replace Q9_03 = 1 if P9_1C_C82=="Inauguração das duas salas de aulas construidas"
replace Q9_03 = 3 if P9_1C_C82=="Construção de uma arrecadação"
replace Q9_03 = 3 if P9_1C_C82=="Manutenção e guarnição"
replace Q9_03 = 3 if P9_1C_C82=="melhorar a pintura da escola"
replace Q9_03 = 4 if P9_1C_C82=="começo das jornadas cientificas"
replace Q9_03 = 4 if P9_1C_C82=="descoberta da atividade agricula e pecuária da regiao"
replace Q9_03 = 9 if P9_1C_C82=="pontualidade e assiduidade dos alunos"
replace Q9_03 = 10 if P9_1C_C82=="formaçao dos professores"
replace Q9_03 = 10 if P9_1C_C82=="intercambio de esperiencia de trabalho"
replace Q9_03 = 10 if P9_1C_C82=="participaçao dos professores nasreunioes metodologicas"
replace Q9_03 = 12 if P9_1C_C82=="Aumento de carteiras"
replace Q9_03 = 12 if P9_1C_C82=="Recebemos quites e saude a material administrativo"
replace Q9_03 = 12 if P9_1C_C82=="reparação do sistema eletrico"
replace Q9_03 = 13 if P9_1C_C82=="Cumprimento dos programas curriculares"
replace Q9_03 = 15 if P9_1C_C82=="abertura do 1 ciclo"
replace Q9_03 = 16 if P9_1C_C82=="aproximação dos professores com os alunos e encarregados de educação"
replace Q9_03 = 16 if P9_1C_C82=="boa comunicaçao com a administração local"
replace Q9_03 = 16 if P9_1C_C82=="comunidade"
replace Q9_03 = 16 if P9_1C_C82=="e as reunioes em conjunto."
replace Q9_03 = 17 if P9_1C_C82=="comparticipação dos encarregados de educação, entrega do coodenador da comissao de pais"
replace Q9_03 = 17 if P9_1C_C82=="o Envolvimento dos encarregados"
replace Q9_03 = 17 if P9_1C_C82=="Presença dos encarregados de educação na escola"

foreach var in Q9_04 Q9_05 Q9_06 Q9_07 Q9_08 Q9_09 Q9_10 Q9_11 Q9_12 Q9_13 Q9_14 Q9_15 Q9_16 Q9_17 Q9_18 Q9_19 Q9_20 Q9_21 Q9_22 Q9_23 Q9_24 Q9_25 Q9_26 Q9_27 Q9_28 Q9_29{
replace `var' = `var'-1
}

gen Q9_30 = 1 if P9_30=="acesso a escola é muito mau"
replace Q9_30 = 1 if P9_30=="Escola de raiz"
replace Q9_30 = 1 if P9_30=="escola desabou por causa da chuva, condiçoes preccarias, necessita de obras de raiz"
replace Q9_30 = 1 if P9_30=="falta de água na escola"
replace Q9_30 = 1 if P9_30=="falta de materia informático, transoprte ou vias de acesso a escola em tempos de chuva, cerco ou quintal escolar, cobertura da escola em degradação constante"
replace Q9_30 = 1 if P9_30=="Falta de salas de aulas, falta de água, vedação do recinto escolara, carteiras paras os alunos e isntalações sanitárias para os alunos"
replace Q9_30 = 1 if P9_30=="Falta uma biblhoteca, kit de primeiros socorros"
replace Q9_30 = 1 if P9_30=="Melhoramento do campo para educaçao fisica, construçao de mais 3 salas de aulas para substituir as salas anexas provisorias, melhorar as infraestruturas antigas"
replace Q9_30 = 1 if P9_30=="salas que tÍm o tecto esra gado"
replace Q9_30 = 2 if P9_30=="Acabamento da construçao da es ola provisória para se fazer uma construçao definitiva, a escola necessita mais carteiras."
replace Q9_30 = 2 if P9_30=="CONSTRUÇAO DE MAIS SALA E COLOCAR GUARDAS"
replace Q9_30 = 2 if P9_30=="Falta de salas de aulas"
replace Q9_30 = 2 if P9_30=="salas de aulas sao poucas"
replace Q9_30 = 2 if P9_30=="falta de salsas de aulas, intalações sanitarias"
replace Q9_30 = 3 if P9_30=="Falta de professores"
replace Q9_30 = 3 if P9_30=="falta de professores especÌfico para determinabas disciplinas, falta de instrumentos para a aula de canto"
replace Q9_30 = 3 if P9_30=="falta de professores, equipamento para uso da escola, computadores, geradores"
replace Q9_30 = 4 if P9_30=="falta de tranporte para as atividades ludicas, falta de material desportivo"
replace Q9_30 = 4 if P9_30=="falta de meios de tranporte pars a escola"
replace Q9_30 = 4 if P9_30=="transporte publico para os docentes na linha da Gabela"
replace Q9_30 = 5 if P9_30=="A falta de segurança,quer para os .Aalunos bem como professor.A falta de computadores,transporte etc."
replace Q9_30 = 5 if P9_30=="Escola não tem guarda"
replace Q9_30 = 6 if P9_30=="falta de merenda escolar,e apetrechamento da casa de professores."

order Q9_30 P9_1A_C80 P9_1B_C81 P9_1C_C82, after(Q9_29)
lab var Q9_30 "Other problems that the respondent considers to be serious in school"

#delimit
lab def Q9_30
1	"Quality of other parts of the school building and/or in general"
2	"Not enough classrooms"
3	"Not enough teachers"
4	"Transportation to and from the school"
5	"No or not enough security"
6	"No or not enough school lunches"
7	"No or not enough water"
8	"No or not enough electricity/light"
9	"No or not enough involvement parents"
;
lab val Q9_30 Q9_30;
#delimit cr
}
********************************************************************************
********************************** SECTION 10 **********************************
********************************************************************************
{
lab var P10_1A "(1) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var P10_1B "(2) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var P10_1C "(3) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"

rename P10_1A Q10_01
rename P10_1B Q10_02
rename P10_1C Q10_03

#delimit;
lab def Q10
1 "Purchase of school books."
2 "Construction/improvement of sanitary facilities."
3 "Increase in the number of classes for students (for example: during the afternoon)."
4 "School meals/snacks."
5 "Purchase/maintenance of furniture (eg desks, benches)."
6 "Extracurricular activities (eg football tournaments)."
7 "School projects (for example: multipurpose field)."
8 "Classroom building / improvement."
9 "Building/improving the library."
10 "Hiring more teachers."
11 "Increase teachers' salary by work day, to encourage attendance."
12 "Teacher training."
13 "School building/improvement in general"
14 "Lock the school yard"
15 "Construction/improvement of teachers' home/room"
16 "Light/electricity (generator)"
17 "Transportation for teachers/students"
18 "Contract security"
19 "Contract someone to clean"
20 "Water"
21 "Increase in the number of class grades at school"
;
lab val Q10_01 Q10_02 Q10_03 Q10;
#delimit cr

replace Q10_01 = . if inlist(Q10_01,13)
replace Q10_02 = . if inlist(Q10_02,13)
replace Q10_03 = . if inlist(Q10_03,13)

replace Q10_01 =20 if P10_1A_C90=="Canalização da água"
replace Q10_01 =5 if P10_1A_C90=="Apetrechamentos com material informatico"
replace Q10_01 =5 if P10_1A_C90=="Apettrechar a direcão com computador internet"
replace Q10_01 =5 if P10_1A_C90=="Aquisição de Giz"
replace Q10_01 =5 if P10_1A_C90=="compra de computadores, internet,impressora"
replace Q10_01 =6 if P10_1A_C90=="projetos educativos da escola. desenvolvimento nas disciplinas de matematica e Portugues"
replace Q10_01 =8 if P10_1A_C90=="aumento do numero de salas de aulas"
replace Q10_01 =8 if P10_1A_C90=="Construção de uma sala de aulas"
replace Q10_01 =13 if P10_1A_C90=="Construção da arrecadação"
replace Q10_01 =13 if P10_1A_C90=="Construção de uma escola nova"
replace Q10_01 =13 if P10_1A_C90=="Melhorar as estruturas, vedação"
replace Q10_01 =13 if P10_1A_C90=="Nada pois está a ser construida uma nova escola de raiz"
replace Q10_01 =13 if P10_1A_C90=="reabilitação da escola"
replace Q10_01 =14 if P10_1A_C90=="Muro de vedação"
replace Q10_01 =14 if P10_1A_C90=="vedação"
replace Q10_01 =14 if P10_1A_C90=="Vedação da escola"
replace Q10_01 =15 if P10_1A_C90=="aumentar o escritorio"
replace Q10_01 =15 if P10_1A_C90=="casa dos professores"
replace Q10_01 =15 if P10_1A_C90=="Construção de sala de professores"
replace Q10_01 =15 if P10_1A_C90=="sala de professores"
replace Q10_01 =16 if P10_1A_C90=="Energia electrica para funcionar as ISTIC"
replace Q10_01 =16 if P10_1A_C90=="ligação 3lectrica"
replace Q10_01 =16 if P10_1A_C90=="aquisição de gerador"
replace Q10_01 =16 if P10_1A_C90=="gerador"
replace Q10_01 =18 if P10_1A_C90=="guarda"

replace Q10_02 =20 if P10_1B_C91=="Canalização de agua ..."
replace Q10_02 =20 if P10_1B_C91=="construção de um reservatório de água"
replace Q10_02 =5 if P10_1B_C91=="apetrechamentos"
replace Q10_02 =5 if P10_1B_C91=="Cmpra de materia informático"
replace Q10_02 =5 if P10_1B_C91=="compra de material para a dirrecçao"
replace Q10_02 =5 if P10_1B_C91=="maquinas pra escrever"
replace Q10_02 =8 if P10_1B_C91=="melhorar as condições da sala de aulas"
replace Q10_02 =13 if P10_1B_C91=="Pintura da escoal"
replace Q10_02 =13 if P10_1B_C91=="Reabbilitação das instalações existentes"
replace Q10_02 =13 if P10_1B_C91=="reabilitacao escola antiga"
replace Q10_02 =14 if P10_1B_C91=="Vedação do quintal"
replace Q10_02 =15 if P10_1B_C91=="Construção de sala para professores"
replace Q10_02 =15 if P10_1B_C91=="contruçao de uma direçao da escola"
replace Q10_02 =16 if P10_1B_C91=="Gerador"
replace Q10_02 =18 if P10_1B_C91=="Seguranças"
replace Q10_02 =19 if P10_1B_C91=="Pessoal auxiliar/empregados de limpesa"

replace Q10_03 =20 if P10_1C_C92=="água canalizada"
replace Q10_03 =20 if P10_1C_C92=="fazer a canalização da água"
replace Q10_03 =20 if P10_1C_C92=="Questão da água"
replace Q10_03 =4 if P10_1C_C92=="Cantina"
replace Q10_03 =5 if P10_1C_C92=="Apetrechamento"
replace Q10_03 =5 if P10_1C_C92=="Aquisição de equipamentos de escritorios"
replace Q10_03 =5 if P10_1C_C92=="carteiras"
replace Q10_03 =5 if P10_1C_C92=="computador, gerador para aulas noturnas"
replace Q10_03 =5 if P10_1C_C92=="computador,impressora e fotocopiadora"
replace Q10_03 =5 if P10_1C_C92=="equipamento electronicos"
replace Q10_03 =7 if P10_1C_C92=="construção de campos multiusos, melhoramento da janelas das salas para melhorar a ventilação"
replace Q10_03 =12 if P10_1C_C92=="ciclos de formaçãopara professorese encarregados"
replace Q10_03 =13 if P10_1C_C92=="Melhorar o acesso a escola"
replace Q10_03 =13 if P10_1C_C92=="recontrução da escola"
replace Q10_03 =13 if P10_1C_C92=="reparação d fechadura"
replace Q10_03 =13 if P10_1C_C92=="reparação da escola."
replace Q10_03 =14 if P10_1C_C92=="vedaçao do muro da escola"
replace Q10_03 =14 if P10_1C_C92=="Vedação do recinto escolar"
replace Q10_03 =14 if P10_1C_C92=="vedaçãoda escola"
replace Q10_03 =15 if P10_1C_C92=="construir resid prof"
replace Q10_03 =15 if P10_1C_C92=="ESIDENCIA PARA PROFESSORES"
replace Q10_03 =15 if P10_1C_C92=="Melhorar o gabinete"
replace Q10_03 =15 if P10_1C_C92=="Residencia para professores"
replace Q10_03 =15 if P10_1C_C92=="sala de professores"
replace Q10_03 =15 if P10_1C_C92=="sala prof"
replace Q10_03 =15 if P10_1C_C92=="sitios de lazer atribuição de prémios"
replace Q10_03 =16 if P10_1C_C92=="compra de um gerador"
replace Q10_03 =16 if P10_1C_C92=="Electricidade"
replace Q10_03 =16 if P10_1C_C92=="iluminação"
replace Q10_03 =17 if P10_1C_C92=="Transporte para o corpo docente da escola"
replace Q10_03 =17 if P10_1C_C92=="TRansporte para os professores"
replace Q10_03 =17 if P10_1C_C92=="transportes para as visitas de estudos para isentivar os alunos a estudar mais"
replace Q10_03 =17 if P10_1C_C92=="Transportes p˙blicos"
replace Q10_03 =18 if P10_1C_C92=="Seguranças"

lab var P10_1A_C90 "AUX"
lab var P10_1B_C91 "AUX"
lab var P10_1C_C92 "AUX"

order Q10_01 Q10_02 Q10_03 P10_1A_C90 P10_1B_C91 P10_1C_C92, after(P9_30_Codes)
}
********************************************************************************
********************************** SECTION 11 **********************************
********************************************************************************
{
lab var P11_Loop_P11_1_Q1 "The motivation of the teachers of this school is high"
lab var P11_Loop_P11_2_Q1 "Teachers work with enthusiasm"
lab var P11_Loop_P11_3_Q1 "Teachers are proud of this school"
lab var P11_Loop_P11_4_Q1 "Teachers value student achievement"

rename P11_Loop_P11_(#)_Q1 Q11_0(#)

forval n=1/4{
replace Q11_0`n' = . if Q11_0`n'==6
lab val Q11_0`n' agree
}

lab var P11_5 "Overall, how satisfied are you with your salary?"
lab var P11_6 "Overall, how satisfied are you with the choice in your professional career?"
lab var P11_7 "Overall, how satisfied are you with your school performance?"

rename P11_5 Q11_05
rename P11_6 Q11_06
rename P11_7 Q11_07

#delimit;
lab def satisfied
1	"Very satisfied"
2	"Satisfied"
3	"Unsatisfied"
4	"Very Unsatisfied"
;
#delimit cr
lab val Q11_05 Q11_06 Q11_07 satisfied

lab var P11_81 "What is the first main reasons why you are dissatisfied with the performance of the school?"
lab var P11_82 "What is the second main reasons why you are dissatisfied with the performance of the school?"
lab var P11_8_C9 "AUX"

rename P11_81 Q11_08_01
rename P11_82 Q11_08_02

replace Q11_08_01 = . if Q11_08_01==9
replace Q11_08_02 = . if Q11_08_02==9
replace Q11_08_01 = 5 if P11_8_C9=="comportamento dos alunos, são indisciplinados, os pais não participam nas atividades da escola"

#delimit;
lab def Q11_08
1 "Low salary"
2 "Poor performance of other teachers"
3 "Poor motivation of other teachers"
4 "Lack of interest of the school principal in it"
5 "Lack of support/commitment of parents/guardians in accompanying children"
6 "Low quality equipment in classrooms"
7 "Low quality infrastructure"
8 "Lack of school books"
;
#delimit cr
lab val Q11_08_01 Q11_08_02 Q11_08
}
********************************************************************************
********************************** SECTION 12 **********************************
********************************************************************************
{
lab var P12_Loop_P12_1_Q1 "Generally speaking, how often do you think school principals are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var P12_Loop_P12_2_Q1 "Generally speaking, how often do you think school principals offer money or favors to be assigned to a specific school?"
lab var P12_Loop_P12_3_Q1 "Generally speaking, how often do you think teachers are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var P12_Loop_P12_4_Q1 "Generally speaking, how often do you think teachers offer money or favors to be assigned to a specific school?"

rename P12_Loop_P12_(#)_Q1 Q12_0(#)
forval n=1/4{
replace Q12_0`n' = . if Q12_0`n'==6
lab val Q12_0`n' freq
}
lab var P12_5 "Would you be in favor of a school reform that would give the management the power to participate in the hiring and firing of the principal?"
rename P12_5 Q12_05
recode Q12_05 (2=0)
lab val Q12_05 dummy

drop P12_61 P12_62
lab var P12_6_C1 "First reason not in favor of the reform in Q12_5"
lab var P12_6_C2 "Second reason not in favor of the reform in Q12_5"
rename P12_6_C1 Q12_06_01
rename P12_6_C2 Q12_06_02

lab var P12_7 "Would you be in favor of a school reform that would give the principal and teachers the power to participate in hiring and firing teachers?"
rename P12_7 Q12_07
recode Q12_07 (2=0)
lab val Q12_07 dummy

drop P12_81 P12_82
lab var P12_8_C1 "First reason not in favor of the reform in Q12_7"
lab var P12_8_C2 "Second reason not in favor of the reform in Q12_7"
rename P12_8_C1 Q12_08_01
rename P12_8_C2 Q12_08_02

lab var P12_9 "Is there anything that you would like to see changed in the functioning of the school or in the educational services of the municipality?"
rename P12_9 Q12_09
recode Q12_09 (2=0)
lab val Q12_09 dummy

lab var P12_10 "What would you like to see changed?"
rename P12_10 Q12_10

lab var P12_11 "Have you ever presented a criticism, complaint or suggestion concerning educational services in the municipality in the last 2 years?"
rename P12_11 Q12_11
recode Q12_11 (2=0)
lab val Q12_11 dummy

lab var P12_12 "Why did not you submit a criticism, complaint or suggestion?"
rename P12_12 Q12_12
replace Q12_12 = . if Q12_12==5
#delimit;
lab def Q12_12
1 "There was no reason for criticism, complaint or suggestion."
2 "Being afraid"
3 "It was not worth it"
4 "The question was put by another person"
;
#delimit cr
lab val Q12_12 Q12_12
lab var P12_12_C5 "AUX"

lab var P12_13 "So far as you know, are there mechanisms for presenting such criticisms, complaints or suggestions?"
rename P12_13 Q12_13
recode Q12_13 (2=0)
lab val Q12_13 dummy

lab var P12_141 "Talked to the school board"
lab var P12_142 "Talked to other school elements"
lab var P12_143 "You left a suggestion in the suggestion box at the school or in a public body"
lab var P12_144 "Through the municipal/provincial education board"
lab var P12_145 "In a forum with those responsible at the commune/municipality level"
lab var P12_146 "Talked to the media (for example: radio, TV, newspaper)"
lab var P12_147 "In a forum with an NGO"
lab var P12_148 "In a forum in the community/church"

rename P12_14(#) Q12_14_0(#)
rename Q12_14_09 P12_149
foreach var in Q12_14_01 Q12_14_02 Q12_14_03 Q12_14_04 Q12_14_05 Q12_14_06 Q12_14_07 Q12_14_08{
lab val `var' dummy
replace `var'=. if Q12_13==0
}

replace Q12_14_01 = 1 if P12_14_C10=="comissao da direcao"
replace Q12_14_04 = 1 if P12_14_C10=="atraves da coordenação comunal"
replace Q12_14_04 = 1 if P12_14_C10=="chefe do ensino geral"
replace Q12_14_04 = 1 if P12_14_C10=="Coordenação de zona"
replace Q12_14_04 = 1 if P12_14_C10=="Fazer uma informação ao diretor municipal"
replace Q12_14_04 = 1 if P12_14_C10=="fazer uma informação e remeter a direcção municipal da educação"
replace Q12_14_04 = 1 if P12_14_C10=="na coordenação"
replace Q12_14_04 = 1 if P12_14_C10=="REUNIAO COM OS MEMBROSCDA DIREÇAO PROVINCIAL"
replace Q12_14_04 = 1 if P12_14_C10=="Por audiencia com o director da repartição"

lab var P12_149 "AUX"
lab var P12_14_C10 "AUX"

lab var P12_15 "Satisfied with the response to criticisms, complaints and suggestions"
rename P12_15 Q12_15
replace Q12_15 = . if Q12_15==3
recode Q12_15 (2=0)
lab val Q12_15 dummy

lab var P12_16 "Why are you not satisfied?"
rename P12_16 Q12_16

order P12_12_C5 P12_149 P12_14_C10, after(Q12_16)
}
********************************************************************************
********************************** SECTION 13 **********************************
********************************************************************************
{
lab var P13_Loop_P13_1_Q1 "Parents in my community still do not understand the benefits that education has in their children's lives"
lab var P13_Loop_P13_2_Q1 "There is a great advantage in sending my children to school, since education will help them to find a better job when they grow up"
rename P13_Loop_P13_1_Q1 Q13_01
rename P13_Loop_P13_2_Q1 Q13_02
lab val Q13_01 Q13_02 agree

lab var P13_3 "Do you think most people would try to be selfish if they had a chance or would they try to be fair?"
lab var P13_4 "Do you generally believe that people are trustworthy or think that 'all care is little'?"
rename P13_3 Q13_03
rename P13_4 Q13_04
replace Q13_03 = . if Q13_03==3
replace Q13_04 = . if Q13_04==3

#delimit;
lab def Q13_03
1 "They would try to be selfish"
2 "They would try to be fair"
;
lab def Q13_04
1 "They are trustworthy"
2 "'All care is little'"
;
#delimit cr
lab val Q13_03 Q13_03
lab val Q13_04 Q13_04

lab var P13_8 				"Do you disagree because the salary is too high or too low?"
rename P13_8 Q13_08
lab def Q13_08 1 "Too high" 2 "Too low"
lab val Q13_08 Q13_08


lab var P13_2Loop_P13_5_Q1 "Teachers take their responsibilities to the students very seriously"
lab var P13_2Loop_P13_6_Q1 "The better a child's education, the more success she will have when she reaches adulthood"
lab var P13_2Loop_P13_7_Q1 "Teachers receive a fair wage for what they do"

lab var P13_3Loop_P13_9_Q1 	"School principals take their responsibilities to the students very seriously"
lab var P13_3Loop_P13_10_Q1 "The teachers are, in general, demoralized"
lab var P13_3Loop_P13_11_Q1 "Teachers can not be criticized for giving explanations to their own students - they have to earn a living in some way"
lab var P13_3Loop_P13_12_Q1 "Teachers can not be criticized for doing odd jobs out of school - they have to earn a living in some way"
lab var P13_3Loop_P13_13_Q1 "Teachers can not be criticized for giving explanations to their own students because there are too few class hours and too many students to cover all the subjects in the program"
lab var P13_3Loop_P13_14_Q1 "Parents/guardians can not be criticized for paying their children's explanations - they are concerned about the results achieved by their children"

rename P13_2Loop_P13_(#)_Q1 Q13_0(#)
rename P13_3Loop_P13_(#)_Q1 Q13_0(#)
rename P13_3Loop_P13_(##)_Q1 Q13_(##)

foreach var in Q13_05 Q13_06 Q13_07 Q13_09 Q13_10 Q13_11 Q13_12 Q13_13 Q13_14{
replace `var' = . if `var'==6
lab val `var' agree
}
}
********************************************************************************
********************************** SECTION 14 **********************************
********************************************************************************
{
lab var P14_1 "Do you belong to any club, community-based organization, economic organization (such as kixikila groups), church or other social group in the community?"
lab var P14_2 "How many of these groups do you belong to?"

rename P14_1 Q14_01
recode Q14_01 (2=0)
lab val Q14_01 dummy

rename P14_2 Q14_02
replace Q14_02 = . if Q14_01==0

forval n=3/9{
drop P14_Loop_`n'_P14_3
drop P14_Loop_`n'_P14_4
drop P14_Loop_`n'_P14_4_C13
drop P14_Loop_`n'_P14_5
drop P14_Loop_`n'_P14_5_Codes
drop P14_Loop_`n'_P14_6
drop P14_Loop_`n'_P14_7
drop P14_Loop_`n'_P14_7_C2
drop P14_Loop_`n'_P14_7_C6
drop P14_Loop_`n'_P14_8
drop P14_Loop_`n'_P14_9
drop P14_Loop_`n'_P14_9_Codes
drop P14_Loop_`n'_P14_10
drop P14_Loop_`n'_P14_10_Codes
drop P14_Loop_`n'_P14_11
drop P14_Loop_`n'_P14_11_C9
}
drop P14_Loop_10_P14_3
drop P14_Loop_10_P14_4
drop P14_Loop_10_P14_4_C13
drop P14_Loop_10_P14_5
drop P14_Loop_10_P14_5_Codes
drop P14_Loop_10_P14_6
drop P14_Loop_10_P14_7
drop P14_Loop_10_P14_7_C2
drop P14_Loop_10_P14_7_C6
drop P14_Loop_10_P14_8
drop P14_Loop_10_P14_9
drop P14_Loop_10_P14_9_Codes
drop P14_Loop_10_P14_10
drop P14_Loop_10_P14_10_Codes
drop P14_Loop_10_P14_11
drop P14_Loop_10_P14_11_C9

rename P14_Loop_0_P14_3 Q14_03_01
rename P14_Loop_1_P14_3 Q14_03_02
rename P14_Loop_2_P14_3 Q14_03_03
rename P14_Loop_0_P14_4 Q14_04_01
rename P14_Loop_1_P14_4 Q14_04_02
rename P14_Loop_2_P14_4 Q14_04_03
rename P14_Loop_0_P14_4_C13 P14_4_1_C13
rename P14_Loop_1_P14_4_C13 P14_4_2_C13
rename P14_Loop_2_P14_4_C13 P14_4_3_C13
rename P14_Loop_0_P14_5 Q14_05_01
rename P14_Loop_1_P14_5 Q14_05_02
rename P14_Loop_2_P14_5 Q14_05_03
rename P14_Loop_0_P14_5_Codes P14_5_1_C
rename P14_Loop_1_P14_5_Codes P14_5_2_C
rename P14_Loop_2_P14_5_Codes P14_5_3_C
rename P14_Loop_0_P14_6 Q14_06_01
rename P14_Loop_1_P14_6 Q14_06_02
rename P14_Loop_2_P14_6 Q14_06_03
rename P14_Loop_0_P14_7 Q14_07_01
rename P14_Loop_1_P14_7 Q14_07_02
rename P14_Loop_2_P14_7 Q14_07_03
rename P14_Loop_0_P14_7_C2 P14_7_1_C2
rename P14_Loop_1_P14_7_C2 P14_7_2_C2
rename P14_Loop_2_P14_7_C2 P14_7_3_C2
rename P14_Loop_0_P14_7_C6 P14_7_1_C6
rename P14_Loop_1_P14_7_C6 P14_7_2_C6
rename P14_Loop_2_P14_7_C6 P14_7_3_C6
rename P14_Loop_0_P14_8 Q14_08_01
rename P14_Loop_1_P14_8 Q14_08_02
rename P14_Loop_2_P14_8 Q14_08_03
rename P14_Loop_0_P14_9 Q14_09_01
rename P14_Loop_1_P14_9 Q14_09_02
rename P14_Loop_2_P14_9 Q14_09_03
rename P14_Loop_0_P14_9_Codes P14_9_1_C
rename P14_Loop_1_P14_9_Codes P14_9_2_C
rename P14_Loop_2_P14_9_Codes P14_9_3_C
rename P14_Loop_0_P14_10 Q14_10_01
rename P14_Loop_1_P14_10 Q14_10_02
rename P14_Loop_2_P14_10 Q14_10_03
rename P14_Loop_0_P14_10_Codes P14_10_1_C
rename P14_Loop_1_P14_10_Codes P14_10_2_C
rename P14_Loop_2_P14_10_Codes P14_10_3_C
rename P14_Loop_0_P14_11 Q14_11_01
rename P14_Loop_1_P14_11 Q14_11_02
rename P14_Loop_2_P14_11 Q14_11_03
rename P14_Loop_0_P14_11_C9 P14_11_1_C7
rename P14_Loop_1_P14_11_C9 P14_11_2_C7
rename P14_Loop_2_P14_11_C9 P14_11_3_C7

lab var Q14_03_01 "(1) What is the name of the organization?"
lab var Q14_03_02 "(2) What is the name of the organization?"
lab var Q14_03_03 "(3) What is the name of the organization?"

lab var Q14_04_01 "(1) What kind of group is the organization?"
lab var Q14_04_02 "(2) What kind of group is the organization?"
lab var Q14_04_03 "(3) What kind of group is the organization?"

lab var Q14_05_01 "(1) How many members does the organization have in this location?"
lab var Q14_05_02 "(2) How many members does the organization have in this location?"
lab var Q14_05_03 "(3) How many members does the organization have in this location?"

lab var Q14_06_01 "(1) Do you hold a leading position in this group?"
lab var Q14_06_02 "(2) Do you hold a leading position in this group?"
lab var Q14_06_03 "(3) Do you hold a leading position in this group?"

lab var Q14_07_01 "(1) Where is the organization located?"
lab var Q14_07_02 "(2) Where is the organization located?"
lab var Q14_07_03 "(3) Where is the organization located?"

lab var Q14_08_01 "(1) Are the members of the organization all of this commune?"
lab var Q14_08_02 "(2) Are the members of the organization all of this commune?"
lab var Q14_08_03 "(3) Are the members of the organization all of this commune?"

lab var Q14_09_01 "NO OBS (1) Since when does this organization exist in the commune where it is located?"
lab var Q14_09_02 "NO OBS (2) Since when does this organization exist in the commune where it is located?"
lab var Q14_09_03 "NO OBS (3) Since when does this organization exist in the commune where it is located?"

lab var Q14_10_01 "NO OBS (1) Since when do you belong to this group?"
lab var Q14_10_02 "NO OBS (2) Since when do you belong to this group?"
lab var Q14_10_03 "NO OBS (3) Since when do you belong to this group?"

lab var Q14_11_01 "(1) How often do you attend the meetings of the organization?"
lab var Q14_11_02 "(2) How often do you attend the meetings of the organization?"
lab var Q14_11_03 "(3) How often do you attend the meetings of the organization?"

lab var P14_4_1_C13 "AUX"
lab var P14_4_2_C13 "AUX"
lab var P14_4_3_C13 "AUX"
lab var P14_5_1_C "AUX"
lab var P14_5_2_C "AUX"
lab var P14_5_3_C "AUX"
lab var P14_7_1_C2 "AUX"
lab var P14_7_2_C2 "AUX"
lab var P14_7_3_C2 "AUX"
lab var P14_7_1_C6 "AUX"
lab var P14_7_2_C6 "AUX"
lab var P14_7_3_C6 "AUX"
lab var P14_9_1_C "AUX"
lab var P14_9_2_C "AUX"
lab var P14_9_3_C "AUX"
lab var P14_10_1_C "AUX"
lab var P14_10_2_C "AUX"
lab var P14_10_3_C "AUX"
lab var P14_11_1_C7 "AUX"
lab var P14_11_2_C7 "AUX"
lab var P14_11_3_C7 "AUX"

#delimit
lab def Q14_04
1 "Association of farmers/fishermen"
2 "Association of merchants/traders"
3 "Professional association (eg doctors, teachers)"
4 "Chamber of Commerce"
5 "CACS communal/municipal"
6 "Religious group"
7 "Political movement"
8 "Cultural association"
9 "Sports Group."
10 "NGOs"
11 "Credit group (kixikila)"
12 "Group based on an ethnic community"
13 "Association based on a group of friends"
;
#delimit cr
lab val Q14_04_01 Q14_04_02 Q14_04_03 Q14_04

replace Q14_05_01 = . if Q14_01==0
replace Q14_05_01 = . if Q14_05_01==999
replace Q14_05_02 = . if Q14_01==0 | Q14_02==1
replace Q14_05_03 = . if Q14_01==0 | Q14_02==1 | Q14_02==2

foreach var in Q14_06_01 Q14_06_02 Q14_06_03{
recode `var' (2=0)
lab val `var' dummy
}

#delimit
lab def Q14_07
1 "In this commune"
2 "In a nearby commune (specify)"
3 "In the capital of the municipality"
4 "Sumbe"
5 "Luanda"
6 "Other (specify)"
;
#delimit cr

rename P14_7_1_C2 Q14_07_01_comuna
rename P14_7_1_C6 Q14_07_01_other

lab var Q14_07_01_comuna "Name of nearby comuna"
lab var Q14_07_01_other "Name of other"

lab val Q14_07_01 Q14_07_02 Q14_07_03 Q14_07

foreach var in Q14_08_01 Q14_08_02 Q14_08_03{
recode `var' (2=0)
lab val `var' dummy
}

*no observations for Q14_09
*no observations for Q14_10

#delimit
lab def Q14_11
1 "Every day"
2 "More than once a week, but not every day"
3 "Once a week"
4 "Once a month"
5 "Once every two months"
6 "Once every three months"
7 "Once every six months"
8 "Once a year"
;
#delimit cr

foreach var in Q14_11_01 Q14_11_02 Q14_11_03{
replace `var'=. if `var'==7
recode `var' (2=3) (3=4) (4=6) (5=7) (6=8)
lab val `var' Q14_11
}

replace Q14_11_01 = 5 if P14_11_1_C7=="2 em dois meses"
replace Q14_11_01 = 2 if P14_11_1_C7=="2 semana"
replace Q14_11_01 = 2 if P14_11_1_C7=="2 vezes por semana"
replace Q14_11_01 = 2 if P14_11_1_C7=="3 vezes por semana"
replace Q14_11_01 = 2 if P14_11_1_C7=="trÍs vezes por semana"

order Q14_07_01_comuna Q14_07_01_other, after(Q14_07_01)
order P14_4_1_C13 P14_4_2_C13 P14_4_3_C13 P14_5_1_C P14_5_2_C P14_5_3_C P14_7_2_C2 P14_7_3_C2 P14_7_2_C6 P14_7_3_C6 P14_9_1_C P14_9_2_C P14_9_3_C P14_10_1_C P14_10_2_C P14_10_3_C P14_11_1_C7 P14_11_2_C7 P14_11_3_C7, after(Q14_11_03)
}
********************************************************************************
********************************** SECTION 15 **********************************
********************************************************************************
{
lab var P15_Loop_P15_1_Q1 	"Most people in this village/neighborhood are available to help if needed"
lab var P15_Loop_P15_2_Q1 	"In this village/neighborhood there are people who want to take advantage of others"
lab var P15_3 				"If you do not have a direct benefit from a community project, would you contribute time or money to this project?"
lab var P15_4 				"In the past year, did you or someone of your household attend a community activity where people came together to work for the community?"
lab var P15_5 				"If, for example, there is a water supply problem in your community, how likely are people to cooperate to solve the problem?"
lab var P15_6 				"In the last year, how often have people in this village/neighborhood come together to ask government officials or political leaders for some improvement in the community?"
lab var P15_7 				"How often do any of these differences divide your village / neighborhood? For example: differences in wealth, income, social status, ethnicity or ethno-linguistic past"
lab var P15_81 				"(1) What are the two differences that cause most often problems?"
lab var P15_82 				"(2) What are the two differences that cause most often problems?"
lab var P15_9 				"Voted in the 2012 general election"
lab var P15_10 				"Do you want to vote in the next elections?"
lab var P15_111 			"(1) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var P15_112 			"(2) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var P15_113 			"(3) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"

rename P15_Loop_P15_(#)_Q1 Q15_0(#)
rename P15_(#) Q15_0(#)
rename P15_81 Q15_08_01
rename P15_82 Q15_08_02
rename P15_10 Q15_10
rename P15_111 Q15_11_01
rename P15_112 Q15_11_02
rename P15_113 Q15_11_03

#delimit
lab def Q15_03
1 "Would only contribute time"
2 "Would only contribute money"
3 "Would contribute time and money"
4 "Neither would contribute time nor money"
;
lab def Q15_05
1 "Very likely"
2 "Likely"
3 "Neither likely nor unlikely"
4 "Unlikely"
5 "Very unlikely"
;
lab def Q15_06
1 "Never"
2 "Once"
3 "Sometimes (less than or equal to 5)"
4 "Often (more than 5)"
;
lab def Q15_07
1 "Very frequent"
2 "Frequent"
3 "Uncommon"
4 "Never"
;
lab def Q15_08
1 "Education"
2 "Land ownership"
3 "Wealth"
4 "Gender"
5 "Differences between new and old generations"
6 "Differences between old and new residents"
7 "Political party affiliation"
8 "Religion"
9 "Ethnic or linguistic past"
10 "Other more specific disputes"
;
lab def Q15_11
1 "Family, friends and neighbors"
2 "Local or community newspapers"
3 "Announcements on community placards"
4 "National newspaper"
5 "Radio"
6 "Television"
7 "Groups or associations"
8 "Business partners or co-workers"
9 "Community leaders"
10 "Government representatives"
11 "NGOs"
12 "Internet"
13 "Other"
;
#delimit cr

replace Q15_01 = . if Q15_01==6
replace Q15_02 = . if Q15_02==6
lab val Q15_01 Q15_02 agree

lab val Q15_03 Q15_03

recode Q15_04 (2=0)
lab val Q15_04 dummy
rename P15_4_Num Q15_04_num
lab var Q15_04_num "How many times did you or someone of your household attend a community activity last year"

lab val Q15_05 Q15_05
lab val Q15_06 Q15_06
lab val Q15_07 Q15_07

replace Q15_08_01 = . if inlist(Q15_08_01,10,11,12)
replace Q15_08_02 = . if inlist(Q15_08_02,10,11,12)
replace Q15_08_02 = 9 if P15_8_C10=="tribalismo"
lab val Q15_08_01 Q15_08_02 Q15_08

recode Q15_09 (2=0)
recode Q15_10 (2=0)
lab val Q15_09 Q15_10 dummy

lab val Q15_11_01 Q15_11_02 Q15_11_03 Q15_11
replace Q15_11_03 = 12 if P15_11_C13=="rede social"

order P15_8_C10 P15_11_C13, after(Q15_11_03)
lab var P15_8_C10 "AUX"
lab var P15_11_C13 "AUX"
}
********************************************************************************
********************************** SECTION 16 **********************************
********************************************************************************
{
lab var P16_1_C1_Q1 "Book : does your household have any?"
lab var P16_1_C2_Q1 "Radio : does your household have any?"
lab var P16_1_C3_Q1 "Television : does your household have any?"
lab var P16_1_C4_Q1 "Computer : does your household have any?"
lab var P16_1_C5_Q1 "Internet : does your household have any?"
lab var P16_1_C6_Q1 "Digital camera : does your household have any?"
lab var P16_1_C7_Q1 "Mobile phone : does your household have any?"
lab var P16_1_C8_Q1 "Bicycle : does your household have any?"
lab var P16_1_C9_Q1 "Motorized : does your household have any?"
lab var P16_1_C10_Q1 "Carro : does your household have any?"
lab var P16_1_C11_Q1 "Oven : does your household have any?"
lab var P16_1_C12_Q1 "Washing machine : does your household have any?"
lab var P16_1_C13_Q1 "Fridge : does your household have any?"
lab var P16_1_C14_Q1 "Stove : does your household have any?"
lab var P16_1_C15_Q1 "Land [in hectares] : does your household have any?"
lab var P16_1_C16_Q1 "House : does your household have any?"
lab var P16_1_C17_Q1 "Farmed animals : does your household have any?"
lab var P16_1_C18_Q1 "Agricultural equipment (tractor) : does your household have any?"

lab var P16_1_C1_Q1_C1 "Book : how many are there in your household?"
lab var P16_1_C2_Q1_C1 "Radio : how many are there in your household?"
lab var P16_1_C3_Q1_C1 "Television : how many are there in your household?"
lab var P16_1_C4_Q1_C1 "Computer : how many are there in your household?"
lab var P16_1_C5_Q1_C1 "Internet : how many are there in your household?"
lab var P16_1_C6_Q1_C1 "Digital camera : how many are there in your household?"
lab var P16_1_C7_Q1_C1 "Mobile phone : how many are there in your household?"
lab var P16_1_C8_Q1_C1 "Bicycle : how many are there in your household?"
lab var P16_1_C9_Q1_C1 "Motorized : how many are there in your household?"
lab var P16_1_C10_Q1_C1 "Carro : how many are there in your household?"
lab var P16_1_C11_Q1_C1 "Oven : how many are there in your household?"
lab var P16_1_C12_Q1_C1 "Washing machine : how many are there in your household?"
lab var P16_1_C13_Q1_C1 "Fridge : how many are there in your household?"
lab var P16_1_C14_Q1_C1 "Stove : how many are there in your household?"
lab var P16_1_C15_Q1_C1 "Land [in hectares] : how many are there in your household?"
lab var P16_1_C16_Q1_C1 "House : how many are there in your household?"
lab var P16_1_C17_Q1_C1 "Farmed animals : how many are there in your household?"
lab var P16_1_C18_Q1_C1 "Agricultural equipment (tractor) : how many are there in your household?"

lab var P16_1_C1_Q2 "Book : total value"
lab var P16_1_C2_Q2 "Radio : total value"
lab var P16_1_C3_Q2 "Television : total value"
lab var P16_1_C4_Q2 "Computer : total value"
lab var P16_1_C5_Q2 "Internet : total value"
lab var P16_1_C6_Q2 "Digital camera : total value"
lab var P16_1_C7_Q2 "Mobile phone : total value : total value"
lab var P16_1_C8_Q2 "Bicycle : total value"
lab var P16_1_C9_Q2 "Motorized : total value"
lab var P16_1_C10_Q2 "Carro : total value"
lab var P16_1_C11_Q2 "Oven : total value"
lab var P16_1_C12_Q2 "Washing machine : total value"
lab var P16_1_C13_Q2 "Fridge : total value"
lab var P16_1_C14_Q2 "Stove : total value"
lab var P16_1_C15_Q2 "Land [in hectares] : total value"
lab var P16_1_C16_Q2 "House : total value"
lab var P16_1_C17_Q2 "Farmed animals : total value"
lab var P16_1_C18_Q2 "Agricultural equipment (tractor) : total value"

lab var P16_1_C1_Q2_Codes "AUX"
lab var P16_1_C2_Q2_Codes "AUX"
lab var P16_1_C3_Q2_Codes "AUX"
lab var P16_1_C4_Q2_Codes "AUX"
lab var P16_1_C5_Q2_Codes "AUX"
lab var P16_1_C6_Q2_Codes "AUX"
lab var P16_1_C7_Q2_Codes "AUX"
lab var P16_1_C8_Q2_Codes "AUX"
lab var P16_1_C9_Q2_Codes "AUX"
lab var P16_1_C10_Q2_Codes "AUX"
lab var P16_1_C11_Q2_Codes "AUX"
lab var P16_1_C12_Q2_Codes "AUX"
lab var P16_1_C13_Q2_Codes "AUX"
lab var P16_1_C14_Q2_Codes "AUX"
lab var P16_1_C15_Q2_Codes "AUX"
lab var P16_1_C16_Q2_Codes "AUX"
lab var P16_1_C17_Q2_Codes "AUX"
lab var P16_1_C18_Q2_Codes "AUX"

destring P16_1_C1_Q1_C1 P16_1_C2_Q1_C1 P16_1_C3_Q1_C1 P16_1_C4_Q1_C1 P16_1_C5_Q1_C1 P16_1_C6_Q1_C1 P16_1_C7_Q1_C1 P16_1_C8_Q1_C1 P16_1_C9_Q1_C1 P16_1_C10_Q1_C1 P16_1_C11_Q1_C1 P16_1_C12_Q1_C1 P16_1_C13_Q1_C1 P16_1_C14_Q1_C1 P16_1_C15_Q1_C1 P16_1_C16_Q1_C1 P16_1_C17_Q1_C1 P16_1_C18_Q1_C1, replace

foreach var in P16_1_C1_Q1 P16_1_C2_Q1 P16_1_C3_Q1 P16_1_C4_Q1 P16_1_C5_Q1 P16_1_C6_Q1 P16_1_C7_Q1 P16_1_C8_Q1 P16_1_C9_Q1 P16_1_C10_Q1 P16_1_C11_Q1 P16_1_C12_Q1 P16_1_C13_Q1 P16_1_C14_Q1 P16_1_C15_Q1 P16_1_C16_Q1 P16_1_C17_Q1 P16_1_C18_Q1{
recode `var' (2=0)
lab val `var' dummy
}

rename P16_1_C(#)_Q1 Q16_01_0(#)
rename P16_1_C(##)_Q1 Q16_01_(##)

rename P16_1_C(#)_Q1_C1 Q16_02_0(#)
rename P16_1_C(##)_Q1_C1 Q16_02_(##)

rename P16_1_C(#)_Q2 Q16_03_0(#)
rename P16_1_C(##)_Q2 Q16_03_(##)
}


order school_id resp_idgame

rename P* DP*
rename Q* DQ*

rename resp_id 			D_resp_id
rename bairro_name 		D_bairro_name
rename time_start  		D_time_start
rename time_finish  	D_time_finish
rename school_name  	D_school_name
rename resp_name  		D_resp_name
rename resp_tel  		D_resp_tel
rename vil_id  			D_vil_id
rename commune_name  	D_commune_name
rename resp_position	D_resp_position
rename D_resp_tel TD_resp_tel


drop 	DP2_1_C12 DP2_38 DP2_3_C_8 DP2_6_C7 DP2_7_C_5 DP2_15_C_8 DP2_20_C_6 ///
		DP2_24_C_10 DP2_25_C_6 DP2_26_C_6 DP2_27_C_6 DP2_281 DP2_282 		///
		DP2_283 DP2_284 DP2_285 DP2_286 DP2_28_C_4 DP2_30_C_9 DP2_31_Codes 	///
		DP3_8_C6 DP3_10_C5 DP4_4_C5 DP4_5_C9 DP4_6_C9 DP4_7_C7 DP5_2_C11 	///
		DP5_41_C10 DP7_3_C6 DP7_4_C6 DP7_5_C5 DP8_1_C4 DP8_2_Other 			///
		DP8_3_C12 DP8_6_C6 DP9_1A_C80 DP9_1B_C81 DP9_1C_C82 DP9_30 			///
		DP9_30_Codes DP10_1A_C90 DP10_1B_C91 DP10_1C_C92 DP11_8_C9 			///
		DP12_12_C5 DP12_149 DP12_14_C10 DP14_4_1_C13 DP14_4_2_C13 			///
		DP14_4_3_C13 DP14_5_1_C DP14_5_2_C DP14_5_3_C DP14_7_2_C2 			///
		DP14_7_3_C2 DP14_7_2_C6 DP14_7_3_C6 DP14_9_1_C DP14_9_2_C 			///
		DP14_9_3_C DP14_10_1_C DP14_10_2_C DP14_10_3_C DP14_11_1_C7 		///
		DP14_11_2_C7 DP14_11_3_C7 DP15_8_C10 DP15_11_C13 					///
		DP16_1_C1_Q2_Codes DP16_1_C2_Q2_Codes DP16_1_C3_Q2_Codes 			///
		DP16_1_C4_Q2_Codes DP16_1_C5_Q2_Codes DP16_1_C6_Q2_Codes 			///
		DP16_1_C7_Q2_Codes DP16_1_C8_Q2_Codes DP16_1_C9_Q2_Codes 			///
		DP16_1_C10_Q2_Codes DP16_1_C11_Q2_Codes DP16_1_C12_Q2_Codes 		///
		DP16_1_C13_Q2_Codes DP16_1_C14_Q2_Codes DP16_1_C15_Q2_Codes 		///
		DP16_1_C16_Q2_Codes DP16_1_C17_Q2_Codes DP16_1_C18_Q2_Codes 		///
		DP1_20_C6 DP2_13 DP6_4_Other DP6_6_C10

rename D_* *

drop resp_id school_name vil_id commune_name bairro_name

rename resp_position director_type

rename DQ1_01 TDbase_age
rename DQ1_02 TDbase_female
rename DQ1_03 TDbase_home_loc2
rename DQ1_03_01 TDbase_home_loc2_other1
rename DQ1_03_02 TDbase_home_loc2_other2
rename DQ1_03_03 TDbase_home_loc2_other3
rename DQ1_04 TDbase_origin_muni
rename DQ1_05 TDbase_origin2
rename DQ1_05_01 TDbase_origin2_other1
rename DQ1_05_02 TDbase_origin2_other2
rename DQ1_05_03 TDbase_origin2_other3
rename DQ1_06 TDbase_leaving_origin
rename DQ1_07 TDbase_arriving_home
rename DQ1_08 TDbase_marital
rename DQ1_09 TDbase_edu_partner
rename DQ1_10 TDbase_ocu_partner
rename DQ1_11 TDbase_income
rename DQ1_12 TDbase_children
rename DQ1_13 TDbase_children_others
rename DQ1_14 TDbase_children_girls
rename DQ1_15 TDbase_children_school
rename DQ1_16_01 TDbase_child1_grade
rename DQ1_16_02 TDbase_child2_grade
rename DQ1_16_03 TDbase_child3_grade
rename DQ1_16_04 TDbase_child4_grade
rename DQ1_16_05 TDbase_child5_grade
rename DQ1_16_06 TDbase_child6_grade
rename DQ1_16_07 TDbase_child7_grade
rename DQ1_16_08 TDbase_child8_grade
rename DQ1_17 TDbase_language
rename DQ1_18 TDbase_home_type
rename DQ1_19 TDbase_transport_distance
rename DQ1_20 TDbase_transport_type
rename DQ1_21 TDbase_transport_time
rename DQ2_01 TDbase_edu
rename DQ2_01_uni TDbase_edu_uni_years
rename DQ2_01_pos TDbase_edu_pos_years
rename DQ2_02 Dbase_schoolman_training
rename DQ2_03_01 TDbase_training_1
rename DQ2_03_02 TDbase_training_2
rename DQ2_03_03 TDbase_training_3
rename DQ2_03_04 TDbase_training_4
rename DQ2_03_05 TDbase_training_5
rename DQ2_03_06 TDbase_training_6
rename DQ2_03_07 TDbase_training_7
rename DQ2_04_month Dbase_dir_this_school_month
rename DQ2_04_year Dbase_dir_this_school_year
rename DQ2_05 Dbase_help_nomination
rename DQ2_06_01 Dbase_help_nomination_1
rename DQ2_06_02 Dbase_help_nomination_2
rename DQ2_06_03 Dbase_help_nomination_3
rename DQ2_06_04 Dbase_help_nomination_4
rename DQ2_06_05 Dbase_help_nomination_5
rename DQ2_06_06 Dbase_help_nomination_6
rename DQ2_06_07 Dbase_help_nomination_7
rename DQ2_06_08 Dbase_help_nomination_8
rename DQ2_07 Dbase_dir_nomination
rename DQ2_08 Dbase_deputy_this_school
rename DQ2_09 Dbase_dir_other_school
rename DQ2_10 Dbase_name_other_school
rename DQ2_11 Dbase_loc1_other_school
rename DQ2_12 Dbase_loc2_other_school
rename DQ2_13 Dbase_dir_other_school_year
rename DQ2_14 Dbase_dir_other_school_years
rename DQ2_15 Dbase_transfer_reason
rename DQ2_15_other Dbase_transfer_reason_other
rename DQ2_16 Dbase_teach
rename DQ2_17 Dbase_teach_this_school_years
rename DQ2_18 Dbase_teach_this_sch_yea_before
rename DQ2_19 Dbase_teach_other_sch_yea_before
rename DQ2_20 TDbase_stay
rename DQ2_21 TDbase_salary
rename DQ2_22 TDbase_bonus_possible
rename DQ2_23 TDbase_bonus_received
rename DQ2_24_01 TDbase_evaluation_how_1
rename DQ2_24_02 TDbase_evaluation_how_2
rename DQ2_24_03 TDbase_evaluation_how_3
rename DQ2_24_04 TDbase_evaluation_how_4
rename DQ2_24_05 TDbase_evaluation_how_5
rename DQ2_24_06 TDbase_evaluation_how_6
rename DQ2_24_07 TDbase_evaluation_how_7
rename DQ2_24_08 TDbase_evaluation_how_8
rename DQ2_24_09 TDbase_evaluation_how_9
rename DQ2_24_10 TDbase_evaluation_how_10
rename DQ2_24_11 TDbase_evaluation_how_11
rename DQ2_24_12 TDbase_evaluation_how_12
rename DQ2_25 TDbase_evaluation_who
rename DQ2_26 Dbase_consequence_good
rename DQ2_27 Dbase_consequence_bad
rename DQ2_28 TDbase_receive_help
rename DQ2_29 TDbase_other_income
rename DQ2_30 Dbase_other_income_type
rename DQ2_31 TDbase_other_income_value

rename DQ3_* TDbase_04_*
rename DQ4_* TD4base_*

rename	 DQ5_01	 TD5base_01
rename	 DQ5_02_01	 TD5base_02_01
rename	 DQ5_02_02	 TD5base_02_02
rename	 DQ5_02_03	 TD5base_02_03
rename	 DQ5_02_04	 TD5base_02_04
rename	 DQ5_02_05	 TD5base_02_05
rename	 DQ5_02_06	 TD5base_02_06
rename	 DQ5_02_07	 TD5base_02_07
rename	 DQ5_02_08	 TD5base_02_08
rename	 DQ5_02_09	 TD5base_02_09
rename	 DQ5_02_10	 TD5base_02_10
rename	 DQ5_02_11	 TD5base_02_11
rename	 DQ5_03_01	 TD5base_03_01
rename	 DQ5_03_02	 TD5base_03_02
rename	 DQ5_03_03	 TD5base_03_03
rename	 DQ5_03_04	 TD5base_03_04
rename	 DQ5_03_05	 TD5base_03_05
rename	 DQ5_03_06	 TD5base_03_06
rename	 DQ5_03_07	 TD5base_03_07
rename	 DQ5_03_08	 TD5base_03_08
rename	 DQ5_03_09	 TD5base_03_09
rename	 DQ5_03_10	 TD5base_03_10
rename	 DQ5_03_11	 TD5base_03_11
rename	 DQ5_04	 TD5base_07
rename	 DQ5_04_01	 TD5base_07_01
rename	 DQ5_04_02	 TD5base_07_02
rename	 DQ5_04_03	 TD5base_07_03
rename	 DQ5_04_04	 TD5base_07_04
rename	 DQ5_04_05	 TD5base_07_05
rename	 DQ5_04_06	 TD5base_07_06
rename	 DQ5_04_07	 TD5base_07_07
rename	 DQ5_04_08	 TD5base_07_08
rename	 DQ5_04_09	 TD5base_07_09
rename	 DQ5_04_10	 TD5base_07_10
rename	 DQ5_04_11	 TD5base_07_11
rename	 DQ5_05_01	 TD5base_08_01
rename	 DQ5_05_02	 TD5base_08_02
rename	 DQ5_05_03	 TD5base_08_03
rename	 DQ5_05_04	 TD5base_08_04
rename	 DQ5_05_05	 TD5base_08_05
rename	 DQ5_05_06	 TD5base_08_06
rename	 DQ5_05_07	 TD5base_08_07
rename	 DQ5_05_08	 TD5base_08_08
rename	 DQ5_05_09	 TD5base_08_09
rename	 DQ5_05_10	 TD5base_08_10
rename	 DQ5_05_11	 TD5base_08_11
rename	 DQ5_06_01	 TD5base_09_01
rename	 DQ5_06_02	 TD5base_09_02
rename	 DQ5_06_03	 TD5base_09_03
rename	 DQ5_06_04	 TD5base_09_04
rename	 DQ5_06_05	 TD5base_09_05
rename	 DQ5_06_06	 TD5base_09_06
rename	 DQ5_06_07	 TD5base_09_07
rename	 DQ5_06_08	 TD5base_09_08
rename	 DQ5_06_09	 TD5base_09_09
rename	 DQ5_06_10	 TD5base_09_10
rename	 DQ5_06_11	 TD5base_09_11

rename DQ6_* TD6abase_*
rename DQ7_* TD6bbase_*
rename DQ8_* TD6cbase_*

rename DQ9_* TD7base_*
rename DQ10_* TD8base_*

rename DQ11_01 TDbase_teacher_motivation
rename DQ11_02 TDbase_teacher_enthusiasm
rename DQ11_03 TDbase_teacher_pride
rename DQ11_04 TDbase_teacher_studentresults
rename DQ11_05 TDbase_satis_salary
rename DQ11_06 TDbase_satis_career
rename DQ11_07 TDbase_school_good
rename DQ11_08_01 TDbase_school_bad_reason1
rename DQ11_08_02 TDbase_school_bad_reason2

rename DQ12_* TD10base_*
rename DQ13_* TD11base_*
rename DQ14_* TD12base_*
rename DQ15_* TD13base_*
rename DQ16_* TD14base_*

gen survey_type = 3

order school_id resp_idgame survey_type


destring TDbase_04_12_02_money, replace

destring TD12base_09_01, replace
destring TD12base_09_02, replace
destring TD12base_09_03, replace
destring TD12base_10_01, replace
destring TD12base_10_02, replace
destring TD12base_10_03, replace


save "$Baseline_dtRaw/_intermediate files/baseline_director.dta", replace
